Merge pull request #3272 from AgentME/dedupeParserOpts

Fix T3084, dedupe parser opts
This commit is contained in:
Henry Zhu
2016-01-17 23:51:29 -05:00

View File

@@ -36,15 +36,17 @@ export default class Parser extends Tokenizer {
if (plugins.indexOf("flow") >= 0) {
// ensure flow plugin loads last
plugins.splice(plugins.indexOf("flow"), 1);
plugins = plugins.filter(plugin => plugin !== "flow");
plugins.push("flow");
}
for (let name of plugins) {
pluginMap[name] = true;
if (!pluginMap[name]) {
pluginMap[name] = true;
let plugin = exports.plugins[name];
if (plugin) plugin(this);
let plugin = exports.plugins[name];
if (plugin) plugin(this);
}
}
return pluginMap;