Browse Source

Comments and other trivia

pull/1032/head
Sami Vaarala 8 years ago
parent
commit
822ba32087
  1. 14
      src-input/duk_bi_object.c
  2. 3
      src-input/duk_bi_reflect.c
  3. 7
      src-input/duk_hobject_props.c

14
src-input/duk_bi_object.c

@ -318,8 +318,8 @@ DUK_INTERNAL duk_ret_t duk_bi_object_prototype_property_is_enumerable(duk_contex
#endif /* DUK_USE_OBJECT_BUILTIN */
#if defined(DUK_USE_OBJECT_BUILTIN) || defined(DUK_USE_REFLECT_BUILTIN)
/* Shared helper to implement Object.getPrototypeOf and the ES6
* Object.prototype.__proto__ getter.
/* Shared helper to implement Object.getPrototypeOf,
* Object.prototype.__proto__ getter, and Reflect.getPrototypeOf.
*
* http://www.ecma-international.org/ecma-262/6.0/index.html#sec-get-object.prototype.__proto__
*/
@ -369,8 +369,8 @@ DUK_INTERNAL duk_ret_t duk_bi_object_getprototype_shared(duk_context *ctx) {
#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */
#if defined(DUK_USE_OBJECT_BUILTIN) || defined(DUK_USE_REFLECT_BUILTIN)
/* Shared helper to implement ES6 Object.setPrototypeOf and
* Object.prototype.__proto__ setter.
/* Shared helper to implement ES6 Object.setPrototypeOf,
* Object.prototype.__proto__ setter, and Reflect.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
@ -390,7 +390,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_setprototype_shared(duk_context *ctx) {
duk_uint_t mask;
duk_int_t magic;
/* Preliminaries for __proto__ and setPrototypeOf (E6 19.1.2.18 steps 1-4) */
/* Preliminaries for __proto__ and setPrototypeOf (E6 19.1.2.18 steps 1-4). */
magic = duk_get_current_magic(ctx);
if (magic == 0) {
duk_push_this_check_object_coercible(ctx);
@ -434,7 +434,7 @@ 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 */
/* [[SetPrototypeOf]] standard behavior, E6 9.1.2. */
/* TODO: implement Proxy object support here */
if (h_new_proto == DUK_HOBJECT_GET_PROTOTYPE(thr->heap, h_obj)) {
@ -444,7 +444,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_setprototype_shared(duk_context *ctx) {
goto fail_nonextensible;
}
for (h_curr = h_new_proto; h_curr != NULL; h_curr = DUK_HOBJECT_GET_PROTOTYPE(thr->heap, h_curr)) {
/* Loop prevention */
/* Loop prevention. */
if (h_curr == h_obj) {
goto fail_loop;
}

3
src-input/duk_bi_reflect.c

@ -1,6 +1,9 @@
/*
* 'Reflect' built-in (ES7 Section 26.1)
* http://www.ecma-international.org/ecma-262/7.0/#sec-reflect-object
*
* Many Reflect built-in functions are provided by shared helpers in
* duk_bi_object.c or duk_bi_function.c.
*/
#include "duk_internal.h"

7
src-input/duk_hobject_props.c

@ -5002,7 +5002,8 @@ void duk_hobject_prepare_property_descriptor(duk_context *ctx,
}
/*
* Object.defineProperty() related helper (E5 Section 15.2.3.6)
* Object.defineProperty() related helper (E5 Section 15.2.3.6).
* Also handles ES6 Reflect.defineProperty().
*
* Inlines all [[DefineOwnProperty]] exotic behaviors.
*
@ -5084,14 +5085,14 @@ duk_bool_t duk_hobject_define_property_helper(duk_context *ctx,
"has_value=%ld value=%!T "
"has_get=%ld get=%p=%!O "
"has_set=%ld set=%p=%!O "
"arr_idx=%ld",
"arr_idx=%ld throw_flag=!%ld",
(long) has_enumerable, (long) is_enumerable,
(long) has_configurable, (long) is_configurable,
(long) has_writable, (long) is_writable,
(long) has_value, (duk_tval *) (idx_value >= 0 ? duk_get_tval(ctx, idx_value) : NULL),
(long) has_get, (void *) get, (duk_heaphdr *) get,
(long) has_set, (void *) set, (duk_heaphdr *) set,
(long) arr_idx));
(long) arr_idx, (long) throw_flag));
/*
* Array exotic behaviors can be implemented at this point. The local variables

Loading…
Cancel
Save