blob: 8a466f1458689e5dec63b9cf3cba2e40a37e23b5 [file] [log] [blame]
let assert = {
sameValue: function (actual, expected) {
if (actual !== expected)
throw new Error("Expected: " + actual + " bug got: " + expected);
},
throws: function (expectedError, op) {
try {
op();
} catch(e) {
if (!(e instanceof expectedError))
throw new Error("Expected to throw: " + expectedError + " but threw: " + e);
}
}
};
class C {
#m() { return 'test'; }
access() {
return this.#m();
}
}
let c1 = new C();
assert.sameValue(c1.access(), 'test');
assert.throws(TypeError, function () {
c1.access.call({});
});
$vm.toUncacheableDictionary(c1);
assert.sameValue(c1.access(), 'test');
assert.throws(TypeError, function () {
c1.access.call({});
});