Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit 88ee6e5

Browse files
committed
[node plugin] Fix undefined variable
Issue angelozerr#430
1 parent 6610659 commit 88ee6e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugin/node.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@
195195
end: tern.outputPos(query, file, wordEnd),
196196
isProperty: false,
197197
completions: completions.map(function(rec) {
198-
var string = JSON.stringify(typeof rec == "string" ? rec : rec.name);
198+
var name = typeof rec == "string" ? rec : rec.name;
199+
var string = JSON.stringify(name);
199200
if (quote == "'") string = quote + string.slice(1, string.length -1).replace(/'/g, "\\'") + quote;
200201
if (typeof rec == "string") return string;
201202
rec.displayName = name;

0 commit comments

Comments
 (0)