Compiler features that claim to be on by default are actually off
WebAssembly features that are apparently on by default are treated by wabt.js as off. Developers need to explicitly opt into all features desired, including features that are on by default.
It looks like desired features are defined here:
function parseWat(filename, buffer, options) {
...
var features = new Features(options || ({}));
function Features(obj) {
this.addr = Module._wabt_new_features();
for (var i = 0; i < FEATURES.length; ++i) {
var feature = FEATURES[i];
this[feature] = obj[feature] | 0;
}
}
FEATURES is an array of strings describing all of the recognized features. this[feature] will only be defined if it is included in obj[feature]. No default value is applied.
When developers try to compile using WAT that includes multi-value, for example, the parser/validator will only allow the code to be compiled if the 'multi_value' flag is explicitly defined. As a developer, I would expect that feature switches marked as on by default would be on.
This should be fixed as of 1.0.32. The same features are enabled by default as in the native tools.