Socket
Socket
Sign inDemoInstall

source-map

Package Overview
Dependencies
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

source-map - npm Package Compare versions

Comparing version 0.1.10 to 0.1.11

12

lib/source-map/source-node.js

@@ -24,4 +24,5 @@ /* -*- Mode: js; js-indent-level: 2; -*- */

* generated JS, or other SourceNodes.
* @param aName The original identifier.
*/
function SourceNode(aLine, aColumn, aSource, aChunks) {
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
this.children = [];

@@ -31,2 +32,3 @@ this.line = aLine === undefined ? null : aLine;

this.source = aSource === undefined ? null : aSource;
this.name = aName === undefined ? null : aName;
if (aChunks != null) this.add(aChunks);

@@ -97,3 +99,6 @@ }

if (chunk !== '') {
aFn(chunk, { source: this.source, line: this.line, column: this.column });
aFn(chunk, { source: this.source,
line: this.line,
column: this.column,
name: this.name });
}

@@ -184,3 +189,4 @@ }

column: generated.column
}
},
name: original.name
});

@@ -187,0 +193,0 @@ }

{
"name": "source-map",
"description": "Generates and consumes source maps",
"version": "0.1.10",
"version": "0.1.11",
"homepage": "https://github.com/mozilla/source-map",

@@ -6,0 +6,0 @@ "author": "Nick Fitzgerald <nfitzgerald@mozilla.com>",

@@ -204,3 +204,3 @@ # Source Map

#### new SourceNode(line, column, source[, chunk])
#### new SourceNode(line, column, source[, chunk[, name]])

@@ -218,2 +218,4 @@ * `line`: The original line number associated with this source node, or null if

* `name`: Optional. The original identifier.
#### SourceNode.prototype.add(chunk)

@@ -220,0 +222,0 @@

@@ -134,3 +134,6 @@ /* -*- Mode: js; js-indent-level: 2; -*- */

['(function () {\n',
' ', new SourceNode(1, 0, 'a.js', ['someCall()']), ';\n',
' ',
new SourceNode(1, 0, 'a.js', 'someCall', 'originalCall'),
new SourceNode(1, 8, 'a.js', '()'),
';\n',
' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';\n',

@@ -154,2 +157,3 @@ '}());']);

assert.equal(actual.column, 0);
assert.equal(actual.name, 'originalCall');

@@ -156,0 +160,0 @@ actual = map.originalPositionFor({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc