Add support for the 'mutable-global' proposal behind a feature flag

This commit is contained in:
dcodeIO
2018-05-08 09:27:56 +02:00
parent 1bf0ca6525
commit 27f0621ee9
8 changed files with 23 additions and 13 deletions

View File

@ -379,8 +379,8 @@ exports.main = function main(argv, options, callback) {
if (typeof features === "string") features = features.split(",");
for (let i = 0, k = features.length; i < k; ++i) {
let name = features[i].trim();
let flag = assemblyscript["FEATURE_" + name.toUpperCase()];
if (!flag) return callback(Error("Feature '" + name + "' is invalid."));
let flag = assemblyscript["FEATURE_" + name.replace(/\-/g, "_").toUpperCase()];
if (!flag) return callback(Error("Feature '" + name + "' is unknown."));
assemblyscript.enableFeature(compilerOptions, flag);
}
}