summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Proxy/define-writable-as-non-writable.js
blob: f764d278f0bc1dd295075c298e1b7aa1ad21308d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"use strict";

var target = {};
Object.defineProperty(target, "test", {configurable: false, writable: true, value: 5});

var proxy = new Proxy(target, {
    defineProperty(target, property) {
        assertEq(property, "test");
        return true;
    }
});

assertThrowsInstanceOf(
    () => Object.defineProperty(proxy, "test", {writable: false}), TypeError);

assertThrowsInstanceOf(
    () => Reflect.defineProperty(proxy, "test", {writable: false}), TypeError);

reportCompare(0, 0);