Skip to content

Commit

Permalink
preparing for release of 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Van Cutsem committed May 27, 2015
1 parent ae423a4 commit 7d33acb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,19 @@ After loading `reflect.js` into your page or other JS environment, be aware that
Object.prototype.hasOwnProperty
Object.getOwnPropertyDescriptor
Object.defineProperty
Object.defineProperties
Object.getOwnPropertyNames
Function.prototype.toString
Date.prototype.toString
Array.isArray
Array.prototype.concat
Proxy

:warning: In node.js, when you `require('harmony-reflect')`, only the current
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
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
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.

Examples
========

Expand Down
13 changes: 13 additions & 0 deletions RELNOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Master (to be v1.3.0)
======

Release date: TBD

New features:

* `Object.defineProperties` is patched and will trigger the `defineProperty` trap when called on a proxy. See issue #51.

Bugfixes:

* `Object.defineProperty(o,p,desc)` now returns `o` (as per ES5 spec) rather than a boolean success value.

v1.2.1
======

Expand Down
7 changes: 6 additions & 1 deletion doc/traps.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ while (!$nxt.done) {
<td>Object.defineProperty(proxy, 'foo', {value:42})</td>
<td>handler.defineProperty(target, 'foo', {value:42,writable:true,enumerable:true,configurable:true})</td>
</tr>
<tr>
<td>defineProperties (10)</td>
<td>Object.defineProperties(proxy, {foo: {value:42}})</td>
<td>handler.defineProperty(target, 'foo', {value:42,writable:true,enumerable:true,configurable:true})</td>
</tr>
<tr>
<td>preventExtensions</td>
<td>Object.preventExtensions(proxy)</td>
Expand Down Expand Up @@ -176,6 +181,6 @@ while (!$nxt.done) {
* (7): assuming that `proxy.valueOf`, which triggers the proxy's "get" trap, returned `Object.prototype.valueOf`.
* (8): assuming that `proxy.toString`, which triggers the proxy's "get" trap, returned `Object.prototype.toString`.
* (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).
* (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).
* (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`.
* (11): only on platforms that support mutable `__proto__` and where `__proto__` is an accessor property defined on `Object.prototype`.
* (12): the `ownKeys` trap must return all own property names. `Object.keys` then retains only the keys denoting enumerable properties.

0 comments on commit 7d33acb

Please sign in to comment.