summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Proxy/isExtensible/return-is-different-from-target.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Proxy/isExtensible/return-is-different-from-target.js')
-rw-r--r--js/src/tests/test262/built-ins/Proxy/isExtensible/return-is-different-from-target.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Proxy/isExtensible/return-is-different-from-target.js b/js/src/tests/test262/built-ins/Proxy/isExtensible/return-is-different-from-target.js
new file mode 100644
index 0000000000..e05b225188
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Proxy/isExtensible/return-is-different-from-target.js
@@ -0,0 +1,28 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 9.5.3
+description: >
+ Throws a TypeError exception if boolean trap result is not the same as
+ target.[[IsExtensible]]() result
+info: |
+ [[IsExtensible]] ( )
+
+ ...
+ 12. If SameValue(booleanTrapResult, targetResult) is false, throw a
+ TypeError exception.
+ ...
+features: [Proxy]
+---*/
+
+var p = new Proxy({}, {
+ isExtensible: function(t) {
+ return false;
+ }
+});
+
+assert.throws(TypeError, function() {
+ Object.isExtensible(p);
+});
+
+reportCompare(0, 0);