mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 06:21:29 +00:00
Add a mechanism to enable additional (experimental) features and start with sign extension operations; Hashing experimentation
This commit is contained in:
12
bin/asc.js
12
bin/asc.js
@ -373,6 +373,18 @@ exports.main = function main(argv, options, callback) {
|
||||
}
|
||||
}
|
||||
|
||||
// Enable additional features if specified
|
||||
var features = args.feature;
|
||||
if (features != null) {
|
||||
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."));
|
||||
assemblyscript.enableFeature(compilerOptions, flag);
|
||||
}
|
||||
}
|
||||
|
||||
var module;
|
||||
stats.compileCount++;
|
||||
(() => {
|
||||
|
@ -149,6 +149,10 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"feature": {
|
||||
"desc": "Enables additional (experimental) WebAssembly features.",
|
||||
"type": "string"
|
||||
},
|
||||
"measure": {
|
||||
"desc": "Prints measuring information on I/O and compile times.",
|
||||
"type": "boolean"
|
||||
|
Reference in New Issue
Block a user