| 1 |
// Copyright (C) 2015 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
/*--- |
| 4 |
es6id: 26.2.2.1 |
| 5 |
description: > |
| 6 |
The returned object has a proxy property which is the created Proxy object |
| 7 |
built with the given target and handler given parameters. |
| 8 |
info: | |
| 9 |
Proxy.revocable ( target, handler ) |
| 10 |
|
| 11 |
6. Perform CreateDataProperty(result, "proxy", p). |
| 12 |
---*/ |
| 13 |
|
| 14 |
var target = { |
| 15 |
attr: "foo" |
| 16 |
}; |
| 17 |
var r = Proxy.revocable(target, { |
| 18 |
get: function(t, prop) { |
| 19 |
return t[prop] + "!"; |
| 20 |
} |
| 21 |
}); |
| 22 |
|
| 23 |
assert.sameValue(r.proxy.attr, "foo!"); |