Fix memory imports, see #36

This commit is contained in:
dcodeIO 2018-03-02 12:57:33 +01:00
parent eef8ef2cd8
commit a5e31200d3
5 changed files with 10 additions and 269 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

263
package-lock.json generated
View File

@ -350,12 +350,6 @@
"lodash": "4.17.4"
}
},
"babel-helper-evaluate-path": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.3.0.tgz",
"integrity": "sha512-dRFlMTqUJRGzx5a2smKxmptDdNCXKSkPcXWzKLwAV72hvIZumrd/0z9RcewHkr7PmAEq+ETtpD1GK6wZ6ZUXzw==",
"dev": true
},
"babel-helper-explode-assignable-expression": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz",
@ -379,12 +373,6 @@
"babel-types": "6.26.0"
}
},
"babel-helper-flip-expressions": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.3.0.tgz",
"integrity": "sha512-kNGohWmtAG3b7tN1xocRQ5rsKkH/hpvZsMiGOJ1VwGJKhnwzR5KlB3rvKBaBPl5/IGHcopB2JN+r1SUEX1iMAw==",
"dev": true
},
"babel-helper-function-name": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz",
@ -418,24 +406,6 @@
"babel-types": "6.26.0"
}
},
"babel-helper-is-nodes-equiv": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz",
"integrity": "sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ=",
"dev": true
},
"babel-helper-is-void-0": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-helper-is-void-0/-/babel-helper-is-void-0-0.3.0.tgz",
"integrity": "sha512-JVqdX8y7Rf/x4NwbqtUI7mdQjL9HWoDnoAEQ8Gv8oxzjvbJv+n75f7l36m9Y8C7sCUltX3V5edndrp7Hp1oSXQ==",
"dev": true
},
"babel-helper-mark-eval-scopes": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.3.0.tgz",
"integrity": "sha512-nrho5Dg4vl0VUgURVpGpEGiwbst5JX7efIyDHFxmkCx/ocQFnrPt8ze9Kxl6TKjR29bJ7D/XKY1NMlSxOQJRbQ==",
"dev": true
},
"babel-helper-optimise-call-expression": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz",
@ -470,12 +440,6 @@
"babel-types": "6.26.0"
}
},
"babel-helper-remove-or-void": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.3.0.tgz",
"integrity": "sha512-D68W1M3ibCcbg0ysh3ww4/O0g10X1CXK720oOuR8kpfY7w0yP4tVcpK7zDmI1JecynycTQYAZ1rhLJo9aVtIKQ==",
"dev": true
},
"babel-helper-replace-supers": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz",
@ -490,12 +454,6 @@
"babel-types": "6.26.0"
}
},
"babel-helper-to-multiple-sequence-expressions": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.3.0.tgz",
"integrity": "sha512-1uCrBD+EAaMnAYh7hc944n8Ga19y3daEnoXWPYDvFVsxMCc1l8aDjksApaCEaNSSuewq8BEcff47Cy1PbLg2Gw==",
"dev": true
},
"babel-helpers": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz",
@ -515,17 +473,6 @@
"babel-runtime": "6.26.0"
}
},
"babel-minify-webpack-plugin": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-minify-webpack-plugin/-/babel-minify-webpack-plugin-0.3.0.tgz",
"integrity": "sha512-avrx0Fa615QfivVV8PakEwOtthts/3qVFV+FYJffJn8WanaX4geKMGTYaPKITUXhqqEfuBJokdRQC5arNTZNIA==",
"dev": true,
"requires": {
"babel-core": "6.26.0",
"babel-preset-minify": "0.3.0",
"webpack-sources": "1.1.0"
}
},
"babel-plugin-check-es2015-constants": {
"version": "6.22.0",
"resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz",
@ -535,101 +482,6 @@
"babel-runtime": "6.26.0"
}
},
"babel-plugin-minify-builtins": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.3.0.tgz",
"integrity": "sha512-MqhSHlxkmgURqj3144qPksbZ/qof1JWdumcbucc4tysFcf3P3V3z3munTevQgKEFNMd8F5/ECGnwb63xogLjAg==",
"dev": true,
"requires": {
"babel-helper-evaluate-path": "0.3.0"
}
},
"babel-plugin-minify-constant-folding": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.3.0.tgz",
"integrity": "sha512-1XeRpx+aY1BuNY6QU/cm6P+FtEi3ar3XceYbmC+4q4W+2Ewq5pL7V68oHg1hKXkBIE0Z4/FjSoHz6vosZLOe/A==",
"dev": true,
"requires": {
"babel-helper-evaluate-path": "0.3.0"
}
},
"babel-plugin-minify-dead-code-elimination": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.3.0.tgz",
"integrity": "sha512-SjM2Fzg85YZz+q/PNJ/HU4O3W98FKFOiP9K5z3sfonlamGOzvZw3Eup2OTiEBsbbqTeY8yzNCAv3qpJRYCgGmw==",
"dev": true,
"requires": {
"babel-helper-evaluate-path": "0.3.0",
"babel-helper-mark-eval-scopes": "0.3.0",
"babel-helper-remove-or-void": "0.3.0",
"lodash.some": "4.6.0"
}
},
"babel-plugin-minify-flip-comparisons": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.3.0.tgz",
"integrity": "sha512-B8lK+ekcpSNVH7PZpWDe5nC5zxjRiiT4nTsa6h3QkF3Kk6y9qooIFLemdGlqBq6j0zALEnebvCpw8v7gAdpgnw==",
"dev": true,
"requires": {
"babel-helper-is-void-0": "0.3.0"
}
},
"babel-plugin-minify-guarded-expressions": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.3.0.tgz",
"integrity": "sha512-O+6CvF5/Ttsth3LMg4/BhyvVZ82GImeKMXGdVRQGK/8jFiP15EjRpdgFlxv3cnqRjqdYxLCS6r28VfLpb9C/kA==",
"dev": true,
"requires": {
"babel-helper-flip-expressions": "0.3.0"
}
},
"babel-plugin-minify-infinity": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.3.0.tgz",
"integrity": "sha512-Sj8ia3/w9158DWieUxU6/VvnYVy59geeFEkVgLZYBE8EBP+sN48tHtBM/jSgz0ejEdBlcfqJ6TnvPmVXTzR2BQ==",
"dev": true
},
"babel-plugin-minify-mangle-names": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.3.0.tgz",
"integrity": "sha512-PYTonhFWURsfAN8achDwvR5Xgy6EeTClLz+fSgGRqjAIXb0OyFm3/xfccbQviVi1qDXmlSnt6oJhBg8KE4Fn7Q==",
"dev": true,
"requires": {
"babel-helper-mark-eval-scopes": "0.3.0"
}
},
"babel-plugin-minify-numeric-literals": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.3.0.tgz",
"integrity": "sha512-TgZj6ay8zDw74AS3yiIfoQ8vRSNJisYO/Du60S8nPV7EW7JM6fDMx5Sar6yVHlVuuwNgvDUBh191K33bVrAhpg==",
"dev": true
},
"babel-plugin-minify-replace": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.3.0.tgz",
"integrity": "sha512-VR6tTg2Lt0TicHIOw04fsUtpPw7RaRP8PC8YzSFwEixnzvguZjZJoL7TgG7ZyEWQD1cJ96UezswECmFNa815bg==",
"dev": true
},
"babel-plugin-minify-simplify": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.3.0.tgz",
"integrity": "sha512-2M16ytQOCqBi7bYMu4DCWn8e6KyFCA108F6+tVrBJxOmm5u2sOmTFEa8s94tR9RHRRNYmcUf+rgidfnzL3ik9Q==",
"dev": true,
"requires": {
"babel-helper-flip-expressions": "0.3.0",
"babel-helper-is-nodes-equiv": "0.0.1",
"babel-helper-to-multiple-sequence-expressions": "0.3.0"
}
},
"babel-plugin-minify-type-constructors": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.3.0.tgz",
"integrity": "sha512-XRXpvsUCPeVw9YEUw+9vSiugcSZfow81oIJT0yR9s8H4W7yJ6FHbImi5DJHoL8KcDUjYnL9wYASXk/fOkbyR6Q==",
"dev": true,
"requires": {
"babel-helper-is-void-0": "0.3.0"
}
},
"babel-plugin-syntax-async-functions": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz",
@ -1019,30 +871,6 @@
"babel-runtime": "6.26.0"
}
},
"babel-plugin-transform-inline-consecutive-adds": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.3.0.tgz",
"integrity": "sha512-iZsYAIjYLLfLK0yN5WVT7Xf7Y3wQ9Z75j9A8q/0IglQSpUt2ppTdHlwl/GeaXnxdaSmsxBu861klbTBbv2n+RA==",
"dev": true
},
"babel-plugin-transform-member-expression-literals": {
"version": "6.9.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.0.tgz",
"integrity": "sha512-bxtac+8w755ctVeDs4vU98RhWY49eW1wO02HAN+eirZYSKk/dVrKONIznXbHmxWKxT4UX1rpTKOCyezuzLpbTw==",
"dev": true
},
"babel-plugin-transform-merge-sibling-variables": {
"version": "6.9.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.0.tgz",
"integrity": "sha512-9G1URVEEKoQLDqe0GwqYudECN7kE/q0OCNo5TiD1iwWnnaKi97xY915l5r2KKUvNflXEm9c3faNWknSXYQ7h6Q==",
"dev": true
},
"babel-plugin-transform-minify-booleans": {
"version": "6.9.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.0.tgz",
"integrity": "sha512-JtpyTRyF+wF/r7GSxpRbNCrVve5M/aCC8xoGcnFItaPUDqjxKmFYvBzMc9u+g0lgo8NWjuZLc16MYaIwkHKD/A==",
"dev": true
},
"babel-plugin-transform-object-rest-spread": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz",
@ -1053,15 +881,6 @@
"babel-runtime": "6.26.0"
}
},
"babel-plugin-transform-property-literals": {
"version": "6.9.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.0.tgz",
"integrity": "sha512-B8s+71+4DPye9+pmZiPGgLPy3YqcmIuvE/9UcZLczPlwL5ALwF6qRUdLC3Fk17NhL6jxp4u33ZVZ8R4kvASPzw==",
"dev": true,
"requires": {
"esutils": "2.0.2"
}
},
"babel-plugin-transform-regenerator": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz",
@ -1071,39 +890,6 @@
"regenerator-transform": "0.10.1"
}
},
"babel-plugin-transform-regexp-constructors": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.3.0.tgz",
"integrity": "sha512-h92YHzyl042rb0naKO8frTHntpRFwRgKkfWD8602kFHoQingjJNtbvZzvxqHncJ6XmKVyYvfrBpDOSkCTDIIxw==",
"dev": true
},
"babel-plugin-transform-remove-console": {
"version": "6.9.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.0.tgz",
"integrity": "sha512-mck9//yGTwObqqqDzY/sISO88/5/XfIB3ILb4uJLXk2xq124NT4yQVjFSRgVSbLcNq8OyBAn2acxKUqg4W/okQ==",
"dev": true
},
"babel-plugin-transform-remove-debugger": {
"version": "6.9.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.0.tgz",
"integrity": "sha512-i/HWGjsmL2d1N2dl+eIzf44XpSP5v7hi1/GXB0xzom9kjrU8js3T8Kadizn95ZxfHK592Vg8P4JJWP/fvimEWw==",
"dev": true
},
"babel-plugin-transform-remove-undefined": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.3.0.tgz",
"integrity": "sha512-TYGQucc8iP3LJwN3kDZLEz5aa/2KuFrqpT+s8f8NnHsBU1sAgR3y8Opns0xhC+smyDYWscqFCKM1gbkWQOhhnw==",
"dev": true,
"requires": {
"babel-helper-evaluate-path": "0.3.0"
}
},
"babel-plugin-transform-simplify-comparison-operators": {
"version": "6.9.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.0.tgz",
"integrity": "sha512-EJyfYeph0CSekwQuwWVwJqy2go/bETkR95iaWQ/HTUis7tkCGNYmXngaFzuIXdmoPXfvmXYCvAXR4/93hqHVjw==",
"dev": true
},
"babel-plugin-transform-strict-mode": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz",
@ -1114,12 +900,6 @@
"babel-types": "6.26.0"
}
},
"babel-plugin-transform-undefined-to-void": {
"version": "6.9.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.0.tgz",
"integrity": "sha512-AVDVEmp0S9mbF1O8zekWbsOOmqnR08PZah5NRZJqSvJnFgiL0ep4Lwo4EymH8OieJR2QgQdR3q71TNW+wiVn4g==",
"dev": true
},
"babel-preset-es2015": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz",
@ -1152,37 +932,6 @@
"babel-plugin-transform-regenerator": "6.26.0"
}
},
"babel-preset-minify": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.3.0.tgz",
"integrity": "sha512-+VV2GWEyak3eDOmzT1DDMuqHrw3VbE9nBNkx2LLVs4pH/Me32ND8DRpVDd8IRvk1xX5p75nygyRPtkMh6GIAbQ==",
"dev": true,
"requires": {
"babel-plugin-minify-builtins": "0.3.0",
"babel-plugin-minify-constant-folding": "0.3.0",
"babel-plugin-minify-dead-code-elimination": "0.3.0",
"babel-plugin-minify-flip-comparisons": "0.3.0",
"babel-plugin-minify-guarded-expressions": "0.3.0",
"babel-plugin-minify-infinity": "0.3.0",
"babel-plugin-minify-mangle-names": "0.3.0",
"babel-plugin-minify-numeric-literals": "0.3.0",
"babel-plugin-minify-replace": "0.3.0",
"babel-plugin-minify-simplify": "0.3.0",
"babel-plugin-minify-type-constructors": "0.3.0",
"babel-plugin-transform-inline-consecutive-adds": "0.3.0",
"babel-plugin-transform-member-expression-literals": "6.9.0",
"babel-plugin-transform-merge-sibling-variables": "6.9.0",
"babel-plugin-transform-minify-booleans": "6.9.0",
"babel-plugin-transform-property-literals": "6.9.0",
"babel-plugin-transform-regexp-constructors": "0.3.0",
"babel-plugin-transform-remove-console": "6.9.0",
"babel-plugin-transform-remove-debugger": "6.9.0",
"babel-plugin-transform-remove-undefined": "0.3.0",
"babel-plugin-transform-simplify-comparison-operators": "6.9.0",
"babel-plugin-transform-undefined-to-void": "6.9.0",
"lodash.isplainobject": "4.0.6"
}
},
"babel-preset-stage-1": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz",
@ -4208,18 +3957,6 @@
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=",
"dev": true
},
"lodash.isplainobject": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
"integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=",
"dev": true
},
"lodash.some": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz",
"integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=",
"dev": true
},
"log-symbols": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.1.0.tgz",

View File

@ -19,7 +19,6 @@
},
"devDependencies": {
"@types/node": "^9.4.6",
"babel-minify-webpack-plugin": "^0.3.0",
"browser-process-hrtime": "^0.1.2",
"chalk": "^2.3.1",
"diff": "^3.4.0",

View File

@ -303,7 +303,7 @@ export class Compiler extends DiagnosticEmitter {
// import memory if requested
if (this.options.importMemory) {
this.module.addMemoryImport("memory", "env", "memory");
this.module.addMemoryImport("0", "env", "memory");
}
// set up function table
@ -4266,7 +4266,7 @@ export class Compiler extends DiagnosticEmitter {
break;
case TypeKind.VOID:
break;
break; // compiles to best fitting type below, being dropped
default:
assert(false);
@ -4290,7 +4290,12 @@ export class Compiler extends DiagnosticEmitter {
// case LiteralKind.OBJECT:
// case LiteralKind.REGEXP:
}
throw new Error("not implemented");
this.error(
DiagnosticCode.Operation_not_supported,
expression.range
);
this.currentType = contextualType;
return this.module.createUnreachable();
}
compileStaticString(stringValue: string): ExpressionRef {