summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Proxy/delete-non-extensible.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/Proxy/delete-non-extensible.js')
-rw-r--r--js/src/tests/non262/Proxy/delete-non-extensible.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/tests/non262/Proxy/delete-non-extensible.js b/js/src/tests/non262/Proxy/delete-non-extensible.js
new file mode 100644
index 0000000000..b31216bb65
--- /dev/null
+++ b/js/src/tests/non262/Proxy/delete-non-extensible.js
@@ -0,0 +1,18 @@
+"use strict";
+
+var target = { test: true };
+Object.preventExtensions(target);
+
+var proxy = new Proxy(target, {
+ deleteProperty(target, property) {
+ return true;
+ }
+});
+
+assertEq(delete proxy.missing, true);
+assertEq(Reflect.deleteProperty(proxy, "missing"), true);
+
+assertThrowsInstanceOf(() => { delete proxy.test; }, TypeError);
+assertThrowsInstanceOf(() => Reflect.deleteProperty(proxy, "test"), TypeError);
+
+reportCompare(0, 0);