blob: ae93a63b6209dc6c06f1dff436a8603269836cac (
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
29
30
31
32
|
// Copyright (C) 2016 Aleksey Shvayka. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
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).
features: [Proxy]
---*/
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);
reportCompare(0, 0);
|