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

Unified Diff: test/mjsunit/wasm/add-getters.js

Issue 2587913005: [wasm] Freeze exports object (Closed)
Patch Set: No IfDebug<T> type :( Created 4 years 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
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/mjsunit/wasm/instantiate-module-basic.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/add-getters.js
diff --git a/test/mjsunit/wasm/add-getters.js b/test/mjsunit/wasm/add-getters.js
index 029f58f11bfec05c74668aeee4e1d27362554308..ca5783a7f97d4642fb6b612bd2442ec1a4890561 100644
--- a/test/mjsunit/wasm/add-getters.js
+++ b/test/mjsunit/wasm/add-getters.js
@@ -12,6 +12,13 @@ function testAddGetter(object, name, val) {
assertSame(val, object[name]);
}
+function testAddGetterFails(object, name, val) {
+ function assign() {
+ Object.defineProperty(object, name, { get: function() { return val; } });
+ }
+ assertThrows(assign, TypeError);
+}
+
function testAddGetterBothWays(object, name, val) {
print("Object.defineProperty");
Object.defineProperty(object, name, { get: function() { return val; } });
@@ -64,5 +71,5 @@ function makeBuilder() {
var builder = makeBuilder();
var exports = builder.instantiate().exports;
testFailToAddGetter(exports, "f", 9834);
- testAddGetter(exports, "nag", new Number(2));
+ testAddGetterFails(exports, "nag", new Number(2));
})();
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/mjsunit/wasm/instantiate-module-basic.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698