.writable = 1
},
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
+
{
.type = NJS_METHOD,
.name = njs_string("slice"),
.value = njs_prop_handler(njs_primitive_prototype_get_proto),
},
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
+
{
.type = NJS_METHOD,
.name = njs_string("valueOf"),
.value = njs_prop_handler(njs_primitive_prototype_get_proto),
},
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
+
{
.type = NJS_METHOD,
.name = njs_string("valueOf"),
.value = njs_string("Error"),
},
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
+
{
.type = NJS_PROPERTY,
.name = njs_string("message"),
.name = njs_string("name"),
.value = njs_string("EvalError"),
},
+
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
};
.name = njs_string("name"),
.value = njs_string("RangeError"),
},
+
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
};
.name = njs_string("name"),
.value = njs_string("ReferenceError"),
},
+
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
};
.name = njs_string("name"),
.value = njs_string("SyntaxError"),
},
+
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
};
.name = njs_string("name"),
.value = njs_string("TypeError"),
},
+
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
};
static const njs_object_prop_t njs_uri_error_prototype_properties[] =
{
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
+
{
.type = NJS_PROPERTY,
.name = njs_string("name"),
.value = njs_value(NJS_NUMBER, 0, 0.0),
},
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
+
{
.type = NJS_METHOD,
.name = njs_string("call"),
.value = njs_prop_handler(njs_primitive_prototype_get_proto),
},
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
+
{
.type = NJS_METHOD,
.name = njs_string("valueOf"),
* "constructor" getter. The properties are set to appropriate function.
*/
-static njs_ret_t
+njs_ret_t
njs_object_prototype_create_constructor(njs_vm_t *vm, njs_value_t *value,
njs_value_t *setval, njs_value_t *retval)
{
njs_object_t *prototype);
njs_ret_t njs_object_prototype_proto(njs_vm_t *vm, njs_value_t *value,
njs_value_t *setval, njs_value_t *retval);
+njs_ret_t njs_object_prototype_create_constructor(njs_vm_t *vm,
+ njs_value_t *value, njs_value_t *setval, njs_value_t *retval);
njs_value_t *njs_property_constructor_create(njs_vm_t *vm, nxt_lvlhsh_t *hash,
njs_value_t *constructor);
njs_ret_t njs_object_prototype_to_string(njs_vm_t *vm, njs_value_t *args,
static const njs_object_prop_t njs_regexp_prototype_properties[] =
{
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
+
{
.type = NJS_PROPERTY_HANDLER,
.name = njs_string("lastIndex"),
.value = njs_prop_handler(njs_primitive_prototype_get_proto),
},
+ {
+ .type = NJS_PROPERTY_HANDLER,
+ .name = njs_string("constructor"),
+ .value = njs_prop_handler(njs_object_prototype_create_constructor),
+ },
+
{
.type = NJS_METHOD,
.name = njs_string("valueOf"),
{ nxt_string("Error.prototype.constructor == Error"),
nxt_string("true") },
+ { nxt_string("Error.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
{ nxt_string("Error().__proto__ == Error.prototype"),
nxt_string("true") },
{ nxt_string("URIError.prototype.constructor == URIError"),
nxt_string("true") },
+ { nxt_string("EvalError.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
+ { nxt_string("RangeError.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
+ { nxt_string("ReferenceError.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
+ { nxt_string("SyntaxError.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
+ { nxt_string("TypeError.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
+ { nxt_string("URIError.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
{ nxt_string("EvalError().__proto__ == EvalError.prototype"),
nxt_string("true") },
{ nxt_string("Object.prototype.constructor === Object"),
nxt_string("true") },
+ { nxt_string("Object.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
{ nxt_string("Object.prototype.__proto__ === null"),
nxt_string("true") },
{ nxt_string("Array.prototype.constructor === Array"),
nxt_string("true") },
+ { nxt_string("Array.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
{ nxt_string("Array.prototype.__proto__ === Object.prototype"),
nxt_string("true") },
{ nxt_string("Boolean.prototype.constructor === Boolean"),
nxt_string("true") },
+ { nxt_string("Boolean.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
{ nxt_string("Boolean.prototype.__proto__ === Object.prototype"),
nxt_string("true") },
{ nxt_string("Number.prototype.constructor === Number"),
nxt_string("true") },
+ { nxt_string("Number.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
{ nxt_string("Number.prototype.__proto__ === Object.prototype"),
nxt_string("true") },
{ nxt_string("String.prototype.constructor === String"),
nxt_string("true") },
+ { nxt_string("String.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
{ nxt_string("String.prototype.__proto__ === Object.prototype"),
nxt_string("true") },
{ nxt_string("Function.prototype.constructor === Function"),
nxt_string("true") },
+ { nxt_string("Function.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
{ nxt_string("Function.prototype.__proto__ === Object.prototype"),
nxt_string("true") },
{ nxt_string("RegExp.prototype.constructor === RegExp"),
nxt_string("true") },
+ { nxt_string("RegExp.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
{ nxt_string("RegExp.prototype.__proto__ === Object.prototype"),
nxt_string("true") },
{ nxt_string("Date.prototype.constructor === Date"),
nxt_string("true") },
+ { nxt_string("Date.prototype.hasOwnProperty('constructor')"),
+ nxt_string("true") },
+
{ nxt_string("Date.prototype.__proto__ === Object.prototype"),
nxt_string("true") },