source-map-js
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -28,2 +28,3 @@ /* -*- Mode: js; js-indent-level: 2; -*- */ | ||
this._skipValidation = util.getArg(aArgs, 'skipValidation', false); | ||
this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false); | ||
this._sources = new ArraySet(); | ||
@@ -111,3 +112,5 @@ this._names = new ArraySet(); | ||
if (!this._skipValidation) { | ||
this._validateMapping(generated, original, source, name); | ||
if (this._validateMapping(generated, original, source, name) === false) { | ||
return; | ||
} | ||
} | ||
@@ -278,7 +281,14 @@ | ||
if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { | ||
throw new Error( | ||
'original.line and original.column are not numbers -- you probably meant to omit ' + | ||
'the original mapping entirely and only map the generated position. If so, pass ' + | ||
'null for the original mapping instead of an object with empty or null values.' | ||
); | ||
var message = 'original.line and original.column are not numbers -- you probably meant to omit ' + | ||
'the original mapping entirely and only map the generated position. If so, pass ' + | ||
'null for the original mapping instead of an object with empty or null values.' | ||
if (this._ignoreInvalidMapping) { | ||
if (typeof console !== 'undefined' && console.warn) { | ||
console.warn(message); | ||
} | ||
return false; | ||
} else { | ||
throw new Error(message); | ||
} | ||
} | ||
@@ -301,3 +311,3 @@ | ||
else { | ||
throw new Error('Invalid mapping: ' + JSON.stringify({ | ||
var message = 'Invalid mapping: ' + JSON.stringify({ | ||
generated: aGenerated, | ||
@@ -307,3 +317,12 @@ source: aSource, | ||
name: aName | ||
})); | ||
}); | ||
if (this._ignoreInvalidMapping) { | ||
if (typeof console !== 'undefined' && console.warn) { | ||
console.warn(message); | ||
} | ||
return false; | ||
} else { | ||
throw new Error(message) | ||
} | ||
} | ||
@@ -310,0 +329,0 @@ }; |
{ | ||
"name": "source-map-js", | ||
"description": "Generates and consumes source maps", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"homepage": "https://github.com/7rulnik/source-map-js", | ||
@@ -6,0 +6,0 @@ "author": "Valentin 7rulnik Semirulnik <v7rulnik@gmail.com>", |
@@ -469,2 +469,5 @@ # Source Map JS | ||
* `ignoreInvalidMapping`: Optional. When `true`, instead of throwing error on | ||
invalid mapping, it will be ignored. | ||
```js | ||
@@ -471,0 +474,0 @@ var generator = new sourceMap.SourceMapGenerator({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
139889
3045
762