blob: f0074b9f11000550513401809662db752e82f98a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Copyright (C) 2016 Aleksey Shvayka. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 9.5.9
esid: sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver
description: >
Pass to target's [[Set]] correct receiver if trap is missing
info: |
[[Set]] (P, V, Receiver)
7. If trap is undefined, then
a. Return ? target.[[Set]](P, V, Receiver).
---*/
var context;
var target = {
set attr(val) {
context = this;
}
};
var p = new Proxy(target, { set: null });
p.attr = 1;
assert.sameValue(context, p);
var pParent = Object.create(new Proxy(target, {}));
pParent.attr = 3;
assert.sameValue(context, pParent);
|