pr = njs_object_property(vm, desc, &pq);
if (pr != NULL) {
data = 1;
- prop->writable = pr->value.data.truth;
+ prop->writable = njs_is_true(&pr->value);
}
pq.key = njs_str_value("enumerable");
pr = njs_object_property(vm, desc, &pq);
if (pr != NULL) {
- prop->enumerable = pr->value.data.truth;
+ prop->enumerable = njs_is_true(&pr->value);
}
pq.key = njs_str_value("configurable");
pr = njs_object_property(vm, desc, &pq);
if (pr != NULL) {
- prop->configurable = pr->value.data.truth;
+ prop->configurable = njs_is_true(&pr->value);
}
if (accessor && data) {
{ njs_str("var o = {}; Object.defineProperty(o, 'a', Object.create({value:1})); o.a"),
njs_str("1") },
+ { njs_str("var o = {}; Object.defineProperty(o, 'a', {writable:'x', enumerable:'y', configurable:'z'});"
+ "var d = Object.getOwnPropertyDescriptor(o, 'a');"
+ "d.writable && d.enumerable && d.configurable"),
+ njs_str("true") },
+
{ njs_str("var o = {a:1, c:2}; Object.defineProperty(o, 'b', {});"
"Object.keys(o)"),
njs_str("a,c") },