Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: test/mjsunit/asm/asm-validation.js

Issue 2664493002: [wasm][asm.js] Make asm.js->wasm return a regular object. (Closed)
Patch Set: fix Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/wasm/wasm-module.cc ('K') | « src/wasm/wasm-module.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/asm/asm-validation.js
diff --git a/test/mjsunit/asm/asm-validation.js b/test/mjsunit/asm/asm-validation.js
index 1f087fc01909827191d0bd23e7a63cbe6aa3f65a..364ecd64d3dd9bd0f233bf917a12beb7aa7657c3 100644
--- a/test/mjsunit/asm/asm-validation.js
+++ b/test/mjsunit/asm/asm-validation.js
@@ -476,3 +476,23 @@ function assertValidAsm(func) {
Module();
assertFalse(% IsAsmWasmCode(Module));
})();
+
+(function TestAsmIsRegular() {
+ function Module() {
+ 'use asm';
+ var g = 123;
+ function foo() {
+ return g | 0;
+ }
+ return {x: foo};
+ }
+ var o = Module();
+ assertValidAsm(Module);
+ assertFalse(o instanceof WebAssembly.Instance);
+ assertTrue(o instanceof Object);
+ assertTrue(o.__proto__ === Object.prototype);
+ o.x = 5;
+ assertTrue(typeof o.x === 'number');
+ assertTrue(o.__single_function__ === undefined);
+ assertTrue(o.__foreign_init__ === undefined);
+})();
« src/wasm/wasm-module.cc ('K') | « src/wasm/wasm-module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698