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

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

Issue 1287913005: Refactor prefs.js for MD-Settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: closure updates Created 5 years, 4 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 8a4d814666b4c4e7422f4f640fbbe892dc7549a0..dba31009928b488dfb7f44950f1ebd8891333357 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
@@ -48,7 +48,8 @@ public class ChromePass extends AbstractPostOrderCallback implements CompilerPas
static final DiagnosticType CR_EXPORT_PATH_WRONG_NUMBER_OF_ARGUMENTS =
DiagnosticType.error("JSC_CR_EXPORT_PATH_WRONG_NUMBER_OF_ARGUMENTS",
- "cr.exportPath() should have exactly 1 argument: namespace name.");
+ "cr.exportPath() should have between 1 and 3 arguments: "
+ + "namespace name[, object to expose[, object to export to]].");
static final DiagnosticType CR_DEFINE_INVALID_FIRST_ARGUMENT =
DiagnosticType.error("JSC_CR_DEFINE_INVALID_FIRST_ARGUMENT",
@@ -250,11 +251,13 @@ public class ChromePass extends AbstractPostOrderCallback implements CompilerPas
}
private void visitExportPath(Node crExportPathNode, Node parent) {
- if (crExportPathNode.getChildCount() != 2) {
+ int childCount = crExportPathNode.getChildCount();
+ if (childCount < 2 || childCount > 4) {
compiler.report(JSError.make(crExportPathNode,
CR_EXPORT_PATH_WRONG_NUMBER_OF_ARGUMENTS));
- return;
}
+ if (childCount != 2)
+ return;
createAndInsertObjectsForQualifiedName(parent,
crExportPathNode.getChildAtIndex(1).getString());
Dan Beam 2015/08/29 01:49:30 cr.exportPath(pathName); // throws without a 'lit
michaelpg 2015/08/29 01:53:23 Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698