v8/test/mjsunit/proxy-super-return-define-property-trap.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
613 B
JavaScript
Raw Normal View History

// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-lazy-feedback-allocation
Proxy.prototype = Object.prototype;
let logs = [];
class Z extends Proxy {
constructor() {
super({}, {
set() {
logs.push("set");
return true;
},
defineProperty() {
logs.push("defineProperty");
return true;
}
})
}
a = 1;
}
new Z();
assertEquals(["defineProperty"], logs);
logs = [];
new Z();
assertEquals(["defineProperty"], logs);