Skip to content

Commit 7d33acb

Browse files
author
Tom Van Cutsem
committed
preparing for release of 1.3.0
1 parent ae423a4 commit 7d33acb

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,19 @@ After loading `reflect.js` into your page or other JS environment, be aware that
7676
Object.prototype.hasOwnProperty
7777
Object.getOwnPropertyDescriptor
7878
Object.defineProperty
79+
Object.defineProperties
7980
Object.getOwnPropertyNames
8081
Function.prototype.toString
8182
Date.prototype.toString
8283
Array.isArray
8384
Array.prototype.concat
8485
Proxy
8586

87+
:warning: In node.js, when you `require('harmony-reflect')`, only the current
88+
module's globals are patched. If you pass an emulated direct proxy to an external module, and that module uses the unpatched globals, the module may not interact with the proxy according to the latest ES6 Proxy API, instead falling
89+
back on the old pre-ES6 Proxy API. This can cause bugs, e.g. the built-in `Array.isArray` will return `false` when passed a proxy-for-array, while the
90+
patched `Array.isArray` will return true. I know of no good fix to reliably patch the globals for all node modules. If you do, let me know.
91+
8692
Examples
8793
========
8894

RELNOTES.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
Master (to be v1.3.0)
2+
======
3+
4+
Release date: TBD
5+
6+
New features:
7+
8+
* `Object.defineProperties` is patched and will trigger the `defineProperty` trap when called on a proxy. See issue #51.
9+
10+
Bugfixes:
11+
12+
* `Object.defineProperty(o,p,desc)` now returns `o` (as per ES5 spec) rather than a boolean success value.
13+
114
v1.2.1
215
======
316

doc/traps.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ while (!$nxt.done) {
139139
<td>Object.defineProperty(proxy, 'foo', {value:42})</td>
140140
<td>handler.defineProperty(target, 'foo', {value:42,writable:true,enumerable:true,configurable:true})</td>
141141
</tr>
142+
<tr>
143+
<td>defineProperties (10)</td>
144+
<td>Object.defineProperties(proxy, {foo: {value:42}})</td>
145+
<td>handler.defineProperty(target, 'foo', {value:42,writable:true,enumerable:true,configurable:true})</td>
146+
</tr>
142147
<tr>
143148
<td>preventExtensions</td>
144149
<td>Object.preventExtensions(proxy)</td>
@@ -176,6 +181,6 @@ while (!$nxt.done) {
176181
* (7): assuming that `proxy.valueOf`, which triggers the proxy's "get" trap, returned `Object.prototype.valueOf`.
177182
* (8): assuming that `proxy.toString`, which triggers the proxy's "get" trap, returned `Object.prototype.toString`.
178183
* (9): the return value of the `getOwnPropertyDescriptor` trap (the property descriptor object) is not the original value returned from the intercepted `Object.getOwnPropertyDescriptor` call. Rather, it is a fresh descriptor object that is guaranteed to be "complete" (i.e. to define values for all relevant ECMAScript property attributes).
179-
* (10): the third argument to the `defineProperty` trap (the property descriptor object) is not the original value passed into the intercepted `Object.defineProperty` call. Rather, it is a fresh descriptor object that is guaranteed to be "complete" (i.e. to define values for all relevant ECMAScript property attributes).
184+
* (10): the third argument to the `defineProperty` trap (the property descriptor object) is not the original value passed into the intercepted `Object.defineProperty` call. Rather, it is a fresh descriptor object that is guaranteed to be "complete" (i.e. to define values for all relevant ECMAScript property attributes). For `Object.defineProperties(proxy,props)`, the proxy's `defineProperty` trap is called for each own enumerable property of `props`.
180185
* (11): only on platforms that support mutable `__proto__` and where `__proto__` is an accessor property defined on `Object.prototype`.
181186
* (12): the `ownKeys` trap must return all own property names. `Object.keys` then retains only the keys denoting enumerable properties.

0 commit comments

Comments
 (0)