2016-11-17 23:26:34 +01:00
|
|
|
// Copyright (C) 2016 Aleksey Shvayka. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
|
|
es6id: 9.5.8
|
|
|
|
esid: sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver
|
|
|
|
description: >
|
2016-11-20 00:13:26 +01:00
|
|
|
Pass to target's [[Get]] correct receiver if trap is missing
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2016-11-17 23:26:34 +01:00
|
|
|
[[Get]] (P, Receiver)
|
|
|
|
|
|
|
|
7. If trap is undefined, then
|
|
|
|
a. Return ? target.[[Get]](P, Receiver).
|
2018-07-21 00:42:39 +02:00
|
|
|
features: [Proxy]
|
2016-11-17 23:26:34 +01:00
|
|
|
---*/
|
|
|
|
|
|
|
|
var target = {
|
2018-02-15 21:11:36 +01:00
|
|
|
get attr() {
|
|
|
|
return this;
|
|
|
|
}
|
2016-11-17 23:26:34 +01:00
|
|
|
};
|
|
|
|
|
2018-02-15 21:11:36 +01:00
|
|
|
var p = new Proxy(target, {
|
|
|
|
get: null
|
|
|
|
});
|
2016-11-17 23:26:34 +01:00
|
|
|
assert.sameValue(p.attr, p);
|
|
|
|
|
|
|
|
var pParent = Object.create(new Proxy(target, {}));
|
|
|
|
assert.sameValue(pParent.attr, pParent);
|