Attach filename property to node.loc when provided.
This commit is contained in:
1
test/fixtures/core/categorized/filename-specified/actual.js
vendored
Normal file
1
test/fixtures/core/categorized/filename-specified/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var node = "shouldHaveFilenameLocProp";
|
||||
109
test/fixtures/core/categorized/filename-specified/expected.json
vendored
Normal file
109
test/fixtures/core/categorized/filename-specified/expected.json
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 39,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 39
|
||||
},
|
||||
"filename": "path/to/input-file.js"
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 39,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 39
|
||||
},
|
||||
"filename": "path/to/input-file.js"
|
||||
},
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 39,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 39
|
||||
},
|
||||
"filename": "path/to/input-file.js"
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 4,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 38
|
||||
},
|
||||
"filename": "path/to/input-file.js"
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 4,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"filename": "path/to/input-file.js"
|
||||
},
|
||||
"name": "node"
|
||||
},
|
||||
"init": {
|
||||
"type": "StringLiteral",
|
||||
"start": 11,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 38
|
||||
},
|
||||
"filename": "path/to/input-file.js"
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": "shouldHaveFilenameLocProp",
|
||||
"raw": "\"shouldHaveFilenameLocProp\""
|
||||
},
|
||||
"value": "shouldHaveFilenameLocProp"
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
test/fixtures/core/categorized/filename-specified/options.json
vendored
Normal file
3
test/fixtures/core/categorized/filename-specified/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"sourceFilename": "path/to/input-file.js"
|
||||
}
|
||||
Reference in New Issue
Block a user