Browse Source

Source ES6 ref updates

pull/343/head
Sami Vaarala 10 years ago
parent
commit
b88137619f
  1. 7
      src/duk_bi_object.c
  2. 4
      src/duk_bi_proxy.c
  3. 2
      src/duk_hobject_enum.c
  4. 4
      src/genbuiltins.py
  5. 2
      src/genstrings.py

7
src/duk_bi_object.c

@ -40,7 +40,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor(duk_context *ctx) {
/* Shared helper to implement Object.getPrototypeOf and the ES6
* Object.prototype.__proto__ getter.
*
* https://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-object.prototype.__proto__
* http://www.ecma-international.org/ecma-262/6.0/index.html#sec-get-object.prototype.__proto__
*/
DUK_INTERNAL duk_ret_t duk_bi_object_getprototype_shared(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
@ -80,8 +80,8 @@ DUK_INTERNAL duk_ret_t duk_bi_object_getprototype_shared(duk_context *ctx) {
/* Shared helper to implement ES6 Object.setPrototypeOf and
* Object.prototype.__proto__ setter.
*
* https://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-object.prototype.__proto__
* https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof
* http://www.ecma-international.org/ecma-262/6.0/index.html#sec-get-object.prototype.__proto__
* http://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.setprototypeof
*/
DUK_INTERNAL duk_ret_t duk_bi_object_setprototype_shared(duk_context *ctx) {
duk_hthread *thr = (duk_hthread *) ctx;
@ -124,7 +124,6 @@ DUK_INTERNAL duk_ret_t duk_bi_object_setprototype_shared(duk_context *ctx) {
DUK_ASSERT(h_obj != NULL);
/* [[SetPrototypeOf]] standard behavior, E6 9.1.2 */
/* NOTE: steps 7-8 seem to be a cut-paste bug in the E6 draft */
/* TODO: implement Proxy object support here */
if (h_new_proto == DUK_HOBJECT_GET_PROTOTYPE(thr->heap, h_obj)) {

4
src/duk_bi_proxy.c

@ -1,5 +1,5 @@
/*
* Proxy built-in (ES6 draft)
* Proxy built-in (ES6)
*/
#include "duk_internal.h"
@ -31,7 +31,7 @@ DUK_INTERNAL duk_ret_t duk_bi_proxy_constructor(duk_context *ctx) {
return DUK_RET_TYPE_ERROR;
}
/* XXX: the returned value is exotic in ES6 (draft), but we use a
/* XXX: the returned value is exotic in ES6, but we use a
* simple object here with no prototype. Without a prototype,
* [[DefaultValue]] coercion fails which is abit confusing.
* No callable check/handling in the current Proxy subset.

2
src/duk_hobject_enum.c

@ -255,7 +255,7 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_context *ctx, duk_small_uint
*
* For keys, we simply skip non-string keys which seems to be
* consistent with how e.g. Object.keys() will process proxy trap
* results (ES6 draft, Section 19.1.2.14).
* results (ES6, Section 19.1.2.14).
*/
if (duk_get_prop_index(ctx, -1, i) && duk_is_string(ctx, -1)) {
/* [ ... enum_target res trap_result val ] */

4
src/genbuiltins.py

@ -237,7 +237,7 @@ bi_global = {
# Duktape specific
{ 'name': 'Duktape', 'value': { 'type': 'builtin', 'id': 'bi_duktape' } },
# ES6 (draft)
# ES6
{ 'name': 'Proxy', 'value': { 'type': 'builtin', 'id': 'bi_proxy_constructor' } },
# Node.js Buffer
@ -1295,7 +1295,7 @@ bi_double_error = {
}
#
# ES6 (draft)
# ES6
#
bi_proxy_constructor = {

2
src/genstrings.py

@ -490,7 +490,7 @@ standard_other_string_list = [
mkstr("set"),
]
# ES6 (draft) specific strings
# ES6 specific strings
es6_string_list = [
mkstr("Proxy", es6=True),
#mkstr("revocable", es6=True),

Loading…
Cancel
Save