@ -46,6 +46,16 @@ function createSingleLineSourceMap() {
return sourceMap ;
return sourceMap ;
}
}
function createSecondLineSourceMap ( ) {
var sourceMap = createEmptySourceMap ( ) ;
sourceMap . addMapping ( {
generated : { line : 2 , column : 0 } ,
original : { line : 1 , column : 0 } ,
source : '.original.js'
} ) ;
return sourceMap ;
}
function createMultiLineSourceMap ( ) {
function createMultiLineSourceMap ( ) {
var sourceMap = createEmptySourceMap ( ) ;
var sourceMap = createEmptySourceMap ( ) ;
for ( var i = 1 ; i <= 100 ; i ++ ) {
for ( var i = 1 ; i <= 100 ; i ++ ) {
@ -270,7 +280,7 @@ it('finds the last sourceMappingURL', function() {
} ) ;
} ) ;
it ( 'default options' , function ( done ) {
it ( 'default options' , function ( done ) {
compareStdout ( done , createS ingl eLineSourceMap( ) , [
compareStdout ( done , createS econd LineSourceMap( ) , [
'' ,
'' ,
'function foo() { throw new Error("this is the error"); }' ,
'function foo() { throw new Error("this is the error"); }' ,
'require("./source-map-support").install();' ,
'require("./source-map-support").install();' ,
@ -286,7 +296,7 @@ it('default options', function(done) {
} ) ;
} ) ;
it ( 'handleUncaughtExceptions is true' , function ( done ) {
it ( 'handleUncaughtExceptions is true' , function ( done ) {
compareStdout ( done , createS ingl eLineSourceMap( ) , [
compareStdout ( done , createS econd LineSourceMap( ) , [
'' ,
'' ,
'function foo() { throw new Error("this is the error"); }' ,
'function foo() { throw new Error("this is the error"); }' ,
'require("./source-map-support").install({ handleUncaughtExceptions: true });' ,
'require("./source-map-support").install({ handleUncaughtExceptions: true });' ,
@ -301,7 +311,7 @@ it('handleUncaughtExceptions is true', function(done) {
} ) ;
} ) ;
it ( 'handleUncaughtExceptions is false' , function ( done ) {
it ( 'handleUncaughtExceptions is false' , function ( done ) {
compareStdout ( done , createS ingl eLineSourceMap( ) , [
compareStdout ( done , createS econd LineSourceMap( ) , [
'' ,
'' ,
'function foo() { throw new Error("this is the error"); }' ,
'function foo() { throw new Error("this is the error"); }' ,
'require("./source-map-support").install({ handleUncaughtExceptions: false });' ,
'require("./source-map-support").install({ handleUncaughtExceptions: false });' ,
@ -350,7 +360,7 @@ it('default options with source map with gap', function(done) {
} ) ;
} ) ;
it ( 'specifically requested error source' , function ( done ) {
it ( 'specifically requested error source' , function ( done ) {
compareStdout ( done , createS ingl eLineSourceMap( ) , [
compareStdout ( done , createS econd LineSourceMap( ) , [
'' ,
'' ,
'function foo() { throw new Error("this is the error"); }' ,
'function foo() { throw new Error("this is the error"); }' ,
'var sms = require("./source-map-support");' ,
'var sms = require("./source-map-support");' ,