mirror of https://github.com/svaarala/duktape.git
Browse Source
Previous behavior was to ignore the setter call, so that attempting a write would be a no-op: "err.fileName = 'dummy';" would do nothing. Because the inherited setter is configurable, the user could still create an own property of the same name using Object.defineProperty() or duk_def_prop() but this is not very intuitive nor very well documented. The updated behavior is to make the .fileName, .lineNumber, and .stack setter make the duk_def_prop() call automatically so that writing to these properties will seem to work as if the property was not an inherited accessor. This matches how e.g. V8 and Spidermonkey work, and also matches how Duktape works when tracebacks are disabled and .fileName and .lineNumber are concrete own properties.pull/390/head
Sami Vaarala
9 years ago
4 changed files with 53 additions and 20 deletions
Loading…
Reference in new issue