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

Unified Diff: lib/src/compiler/code_generator.dart

Issue 2200913002: fixes #616, statics on callable functions (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 5 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_sdk.js ('k') | test/codegen/language/callable_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/code_generator.dart
diff --git a/lib/src/compiler/code_generator.dart b/lib/src/compiler/code_generator.dart
index b1ee1f69cec6b851ef16941c982486a0047766f7..15a99c1d0764379f27df974bd20364546d2e1e5b 100644
--- a/lib/src/compiler/code_generator.dart
+++ b/lib/src/compiler/code_generator.dart
@@ -808,9 +808,8 @@ class CodeGenerator extends GeneralizingAstVisitor
JS.Fun _emitCallableClassConstructor(ConstructorElement ctor) {
return js.call(
r'''function (...args) {
- const self = this;
function call(...args) {
- return self.call.apply(self, args);
+ return call.call.apply(call, args);
}
call.__proto__ = this.__proto__;
call.#.apply(call, args);
@@ -1416,7 +1415,7 @@ class CodeGenerator extends GeneralizingAstVisitor
var args = new JS.TemporaryId('args');
var fnArgs = <JS.Parameter>[];
- JS.Expression positionalArgs;;
+ JS.Expression positionalArgs;
if (method.type.namedParameterTypes.isNotEmpty) {
addProperty(
@@ -1442,8 +1441,8 @@ class CodeGenerator extends GeneralizingAstVisitor
}
}
- var fnBody = js.call(
- 'this.noSuchMethod(new dart.InvocationImpl(#, #, #))', [
+ var fnBody =
+ js.call('this.noSuchMethod(new dart.InvocationImpl(#, #, #))', [
_elementMemberName(method),
positionalArgs,
new JS.ObjectInitializer(invocationProps)
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | test/codegen/language/callable_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698