|
|
@ -105,10 +105,6 @@ int duk_builtin_error_prototype_to_string(duk_context *ctx) { |
|
|
|
return DUK_RET_TYPE_ERROR; |
|
|
|
} |
|
|
|
|
|
|
|
/* FIXME: This needs to actually be a getter/setter pair, this is
|
|
|
|
* for prototyping traceback formatting. The resulting code is |
|
|
|
* also way too large, so needs rework. |
|
|
|
*/ |
|
|
|
int duk_builtin_error_prototype_stack_getter(duk_context *ctx) { |
|
|
|
duk_hthread *thr = (duk_hthread *) ctx; |
|
|
|
int idx_td; |
|
|
@ -220,25 +216,18 @@ int duk_builtin_error_prototype_stack_getter(duk_context *ctx) { |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
int duk_builtin_error_prototype_stack_setter(duk_context *ctx) { |
|
|
|
/* At the moment, a silent no-op. */ |
|
|
|
DUK_ASSERT_TOP(ctx, 1); /* fixed arg count */ |
|
|
|
#if 0 |
|
|
|
/* Write an own 'stack' property with the new value, which then
|
|
|
|
* shadows the accessor. |
|
|
|
*/ |
|
|
|
int duk_builtin_error_prototype_filename_getter(duk_context *ctx) { |
|
|
|
return DUK_RET_UNIMPLEMENTED_ERROR; |
|
|
|
} |
|
|
|
|
|
|
|
/* FIXME: This would need to define an own property skipping the normal
|
|
|
|
* property protections. The current helpers for doing raw property |
|
|
|
* setting bypass Ecmascript attribute semantics so they are not |
|
|
|
* appropriate here. What's needed here is a helper for doing what |
|
|
|
* Object.defineProperty() does but with a nice API. One could also |
|
|
|
* simply check that 'this' has no own 'stack 'property' and only |
|
|
|
* force the property to be defined in this case. |
|
|
|
int duk_builtin_error_prototype_linenumber_getter(duk_context *ctx) { |
|
|
|
return DUK_RET_UNIMPLEMENTED_ERROR; |
|
|
|
} |
|
|
|
|
|
|
|
int duk_builtin_error_prototype_nop_setter(duk_context *ctx) { |
|
|
|
/* Attempt to write 'stack', 'fileName', 'lineNumber' is a silent no-op.
|
|
|
|
* User can use Object.defineProperty() to override this behavior. |
|
|
|
*/ |
|
|
|
duk_push_this(ctx); |
|
|
|
duk_insert(ctx, 0); /* -> [ this val ] */ |
|
|
|
duk_put_prop_stridx(ctx, -2, DUK_STRIDX_STACK); |
|
|
|
#endif |
|
|
|
DUK_ASSERT_TOP(ctx, 1); /* fixed arg count */ |
|
|
|
return 0; |
|
|
|
} |
|
|
|