Details
-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
None
-
None
-
generic
-
generic
Description
The list of missing features to have node modules that rely on v8 error API(specified by : http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi) to work properly.
Points1) 2) 4) and 5) are must have and can't be implemented in avatar-is without Nashorn support.
1) Error constructor should capture the stack.
2) Error constructor should call prepareStackTrace.
3) captureStackTrace should call prepareStackTrace.
4) captureStackTrace should support option argument (a function to limit stackTrace). e.g.: Error.captureStackTrace(obj, arguments.callee);
5) Support for Callsite properties. The most properties we can get, we will not have all.
6) Stack filename shouldn't be an URL, file/xxx ==> /xxx, some modules load file from the filesystem using this information...
7) Support for Error.stackTraceLimit, optional, didn't find a module using it. But we could.
8) stack property of an Error shouldn't be replaced when throwing this error
9) Error properties are not enumerable, Object.keys called on an Error instance returns an empty array.
Typical rethrow case:
var backtrace = new Error;
Error.captureStackTrace(backtrace);
doit();
function doit() {
throw backtrace;//doit function not in the stack!
}
Typical stack customisation:
function getStackofCallSites() {
var orig = Error.prepareStackTrace;
Error.prepareStackTrace = function(_, stack){ return stack; };
var err = {};
Error.captureStackTrace(err, arguments.callee);
Error.prepareStackTrace = orig;
return err.stack;
}
Points1) 2) 4) and 5) are must have and can't be implemented in avatar-is without Nashorn support.
1) Error constructor should capture the stack.
2) Error constructor should call prepareStackTrace.
3) captureStackTrace should call prepareStackTrace.
4) captureStackTrace should support option argument (a function to limit stackTrace). e.g.: Error.captureStackTrace(obj, arguments.callee);
5) Support for Callsite properties. The most properties we can get, we will not have all.
6) Stack filename shouldn't be an URL, file/xxx ==> /xxx, some modules load file from the filesystem using this information...
7) Support for Error.stackTraceLimit, optional, didn't find a module using it. But we could.
8) stack property of an Error shouldn't be replaced when throwing this error
9) Error properties are not enumerable, Object.keys called on an Error instance returns an empty array.
Typical rethrow case:
var backtrace = new Error;
Error.captureStackTrace(backtrace);
doit();
function doit() {
throw backtrace;//doit function not in the stack!
}
Typical stack customisation:
function getStackofCallSites() {
var orig = Error.prepareStackTrace;
Error.prepareStackTrace = function(_, stack){ return stack; };
var err = {};
Error.captureStackTrace(err, arguments.callee);
Error.prepareStackTrace = orig;
return err.stack;
}
Attachments
Issue Links
- relates to
-
JDK-8032068 implement @sourceURL and #sourceURL directives
- Resolved
-
JDK-8031983 Error objects should capture stack at the constructor
- Resolved
-
JDK-8032004 instance property "message" of Error objects should be non-enumerable
- Resolved