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

Unified Diff: compiler/java/com/google/dart/compiler/backend/js/ClosureJsBackend.java

Issue 8232014: Fix named parameters handling of values that are falsy in JS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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: compiler/java/com/google/dart/compiler/backend/js/ClosureJsBackend.java
===================================================================
--- compiler/java/com/google/dart/compiler/backend/js/ClosureJsBackend.java (revision 350)
+++ compiler/java/com/google/dart/compiler/backend/js/ClosureJsBackend.java (working copy)
@@ -490,7 +490,7 @@
* due to the renaming.
*/
options.setReplaceIdGenerators(false);
-
+
return options;
}
@@ -551,6 +551,8 @@
// Add a declarations for the V8 logging function.
private static final String UNIT_TEST_EXTERN_STUBS = "var write;";
+ private static final String CLOSURE_PRIMITIVES = "function JSCompiler_renameProperty() {};";
+
// TODO(johnlenz): include json.js in the default set of externs.
private static final String MISSING_EXTERNS =
"var JSON = {};\n" +
@@ -615,6 +617,9 @@
// Add methods used when running the unit tests.
externs.add(JSSourceFile.fromCode("unitTestStubs", UNIT_TEST_EXTERN_STUBS));
+ // Add methods used by Closure Compiler itself.
+ externs.add(JSSourceFile.fromCode("closureCompilerPrimitives", CLOSURE_PRIMITIVES));
+
return externs;
}
@@ -646,4 +651,9 @@
protected boolean shouldOptimize() {
return (fastOutput) ? false : true;
}
+
+ @Override
+ protected boolean generateClosureCompatibleCode() {
+ return true;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698