return native code CallSite as is
This commit is contained in:
parent
70c54a8ab6
commit
91c828e375
@ -306,6 +306,10 @@ function cloneCallSite(frame) {
|
||||
}
|
||||
|
||||
function wrapCallSite(frame) {
|
||||
if(frame.isNative()) {
|
||||
return frame;
|
||||
}
|
||||
|
||||
// Most call sites will return the source file from getFileName(), but code
|
||||
// passed to eval() ending in "//# sourceURL=..." will return the source file
|
||||
// from getScriptNameOrSourceURL() instead
|
||||
|
10
test.js
10
test.js
@ -222,6 +222,16 @@ it('eval with sourceURL inside eval', function() {
|
||||
]);
|
||||
});
|
||||
|
||||
it('native function', function() {
|
||||
compareStackTrace(createSingleLineSourceMap(), [
|
||||
'[1].map(function(x) { throw new Error(x); });'
|
||||
], [
|
||||
'Error: 1',
|
||||
/\/.original\.js/,
|
||||
/at Array\.map \(native\)/
|
||||
]);
|
||||
});
|
||||
|
||||
it('function constructor', function() {
|
||||
compareStackTrace(createMultiLineSourceMap(), [
|
||||
'throw new Function(")");'
|
||||
|
Loading…
Reference in New Issue
Block a user