Skip to content

Commit cead601

Browse files
committed
Fix method calls.
1 parent 6268c57 commit cead601

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

JSLint.coffee

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ walk = (ast) ->
8585
ast[2] = walk ast[2]
8686
ast[3] = walk ast[3]
8787
else if type is 'call'
88-
ast[1] = walk ast[1]
8988
funcName = ast[1]
89+
if ast[1][0] is 'dot'
90+
ast[1][1] = walk ast[1][1]
91+
else
92+
ast[1] = walk ast[1]
9093
params = ast[2]
9194
for ast2, i in ast[2]
9295
ast[2][i] = walk ast2
@@ -197,7 +200,20 @@ walk = (ast) ->
197200
]
198201
]
199202
else if type is 'string'
200-
ast[1] = ast[1].replace(/\<\//g,"<\\/")
203+
a = ast[1].indexOf("</")
204+
if a > -1
205+
ast = [
206+
'binary'
207+
'+'
208+
[
209+
'string'
210+
ast[1].substr(0,a+1)
211+
]
212+
walk [
213+
'string'
214+
ast[1].substr(a+1)
215+
]
216+
]
201217
else
202218
console.error "Unknown type: '#{type}'"
203219
console.log util.inspect ast, false, null, true

0 commit comments

Comments
 (0)