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)); |
})(); |