http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi

I have this code that's been working until recently:

Error.stackTraceLimit = 50;

Error.prepareStackTrace = function(error, structuredStackTrace) {
var stack = [];
structuredStackTrace.each(function(item) {
stack.push({
scriptName: item.getScriptNameOrSourceURL(),
typeName: item.getTypeName(),
functionName: item.getFunctionName(),
methodName: item.getMethodName(),
fileName: item.getFileName(),
lineNumber: item.getLineNumber(),
columnNumer: item.getColumnNumber(),
evalOrgin: item.getEvalOrigin(),
isTopLevel: item.isToplevel(),
isEval: item.isEval(),
isNative: item.isNative(),
isConstructor: item.isConstructor()
});
});
return stack;
}

Now when this code is called, I'm getting an exception thrown (in my 
exception handler):

Exceptions.js:8: TypeError: Cannot read property 'constructor' of undefined
typeName: item.getTypeName(),

If I dump the contents of item in the loop, I get this output:

10316 (object) :
 [receiver] : (undefined) undefined
 [fun] : function() { ... }
 [pos] : (number) 2610

builtin/Exceptions.js:9: TypeError: Cannot read property 'constructor' of 
undefined
typeName: item.getTypeName(),
                  ^
10316 (object) :
 [receiver] : (object) :
   [receiver] : (undefined) undefined
   [fun] : function() { ... }
   [pos] : (number) 2610
 [fun] : function CallSiteGetTypeName() { [native code] }
 [pos] : (number) 16159

no stack trace available
Invoking service ModulesService.getModule
10319 exceptionHandler
(object) :
 [message] : (string) No such schema AnnouncementsModule

10319 (object) :
 [receiver] : (undefined) undefined
 [fun] : function() { ... }
 [pos] : (number) 2610

builtin/Exceptions.js:9: TypeError: Cannot read property 'constructor' of 
undefined
typeName: item.getTypeName(),
                  ^
10319 (object) :
 [receiver] : (object) :
   [receiver] : (undefined) undefined
   [fun] : function() { ... }
   [pos] : (number) 2610
 [fun] : function CallSiteGetTypeName() { [native code] }
 [pos] : (number) 16159


What's going on, guys?

If there's a radical change to the API, please update the WWW page above. 
 All the information available by calling those item.get*() methods is 
REALLY useful...

Thanks in advance.



-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to