Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: third_party/closure_compiler/runner/src/com/google/javascript/jscomp/ChromePass.java

Issue 543863002: Typecheck chrome://bookmarks using Closure Compiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@true_master
Patch Set: debug warns Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/closure_compiler/runner/src/com/google/javascript/jscomp/ChromePass.java
diff --git a/third_party/closure_compiler/runner/src/com/google/javascript/jscomp/ChromePass.java b/third_party/closure_compiler/runner/src/com/google/javascript/jscomp/ChromePass.java
index d89782358003410cb798aa6b43b5ebd596ba2d24..274f0f892877e20af441e3dba478dfe5055c47e4 100644
--- a/third_party/closure_compiler/runner/src/com/google/javascript/jscomp/ChromePass.java
+++ b/third_party/closure_compiler/runner/src/com/google/javascript/jscomp/ChromePass.java
@@ -313,11 +313,11 @@ public class ChromePass extends AbstractPostOrderCallback implements CompilerPas
for (Node keyNode : objectLit.children()) {
String key = keyNode.getString();
- // TODO(vitalyp): Can dict value be other than a simple NAME? What if NAME doesn't
- // refer to a function/constructor?
- String value = keyNode.getFirstChild().getString();
-
- res.put(value, key);
+ Node valueNode = keyNode.getFirstChild();
+ if (valueNode.isName()) {
+ String value = keyNode.getFirstChild().getString();
+ res.put(value, key);
+ }
}
return res;

Powered by Google App Engine
This is Rietveld 408576698