Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
f0b2046c
Commit
f0b2046c
authored
Jun 14, 2019
by
rocky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
findNodeAtSourceLocation bugfixes
parent
283705cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
sourceMappings.ts
remix-astwalker/src/sourceMappings.ts
+5
-6
No files found.
remix-astwalker/src/sourceMappings.ts
View file @
f0b2046c
...
...
@@ -66,18 +66,17 @@ export class SourceMappings {
return
found
;
}
findNodeAtSourceLocation
(
astNodeType
:
string
,
sourceLocation
:
Location
,
ast
:
AstNode
|
null
)
{
findNodeAtSourceLocation
(
astNodeType
:
string
|
undefined
,
sourceLocation
:
Location
,
ast
:
AstNode
|
null
):
AstNode
|
null
{
const
astWalker
=
new
AstWalker
()
const
callback
=
{};
let
found
=
null
;
/* FIXME: Looking at AST walker code,
I don't understand a need to return a boolean. */
c
allback
[
'*'
]
=
function
(
node
:
AstNode
)
{
c
onst
callback
=
function
(
node
:
AstNode
)
{
let
nodeLocation
=
sourceLocationFromAstNode
(
node
);
if
(
nodeLocation
&&
nodeLocation
.
start
<
=
sourceLocation
.
start
&&
nodeLocation
.
start
+
nodeLocation
.
length
>=
sourceLocation
.
start
+
sourceLocation
.
length
)
{
if
(
astNodeType
===
node
.
nodeType
)
{
nodeLocation
.
start
=
=
sourceLocation
.
start
&&
nodeLocation
.
length
==
sourceLocation
.
length
)
{
if
(
astNodeType
==
undefined
||
astNodeType
==
=
node
.
nodeType
)
{
found
=
node
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment