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

Unified Diff: lib/src/codegen/js_codegen.dart

Issue 1048873002: fix arguments keyword used in our helper method (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « lib/runtime/dart/core.js ('k') | lib/src/codegen/js_names.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 5c4b442e3a414a108e780cc25c0306d69fd3ce16..5c7b474568f4a027ac43991ac308101c3851e47d 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -616,15 +616,17 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
// settles. See <https://github.com/dart-lang/dev_compiler/issues/51>.
// Performance of this pattern is likely to be bad.
name = 'constructor';
+ // Mark the parameter as no-rename.
+ var args = new JS.Identifier('arguments', allowRename: false);
body = js.statement('''{
// Get the class name for this instance.
var name = this.constructor.name;
// Call the default constructor.
var init = this[name];
var result = void 0;
- if (init) result = init.apply(this, arguments);
+ if (init) result = init.apply(this, #);
return result === void 0 ? this : result;
- }''');
+ }''', args);
} else {
body = _emitConstructorBody(node, fields);
}
« no previous file with comments | « lib/runtime/dart/core.js ('k') | lib/src/codegen/js_names.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698