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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart

Issue 2661873002: Introduce ConstructorEntity (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.js_emitter.interceptor_stub_generator; 5 library dart2js.js_emitter.interceptor_stub_generator;
6 6
7 import '../compiler.dart' show Compiler; 7 import '../compiler.dart' show Compiler;
8 import '../constants/values.dart'; 8 import '../constants/values.dart';
9 import '../elements/entities.dart'; 9 import '../elements/entities.dart';
10 import '../elements/types.dart' show InterfaceType; 10 import '../elements/types.dart' show InterfaceType;
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 // A.foo() {} 397 // A.foo() {}
398 // A.bar() {} 398 // A.bar() {}
399 // } 399 // }
400 // 400 //
401 // Which are described by the map 401 // Which are described by the map
402 // 402 //
403 // {"": A.A$, "foo": A.A$foo, "bar": A.A$bar} 403 // {"": A.A$, "foo": A.A$foo, "bar": A.A$bar}
404 // 404 //
405 // We expect most of the time the map will be a singleton. 405 // We expect most of the time the map will be a singleton.
406 var properties = []; 406 var properties = [];
407 for (FunctionEntity member in analysis.constructors(classElement)) { 407 for (ConstructorEntity member in analysis.constructors(classElement)) {
408 properties.add(new jsAst.Property(js.string(member.name), 408 properties.add(new jsAst.Property(js.string(member.name),
409 backend.emitter.staticFunctionAccess(member))); 409 backend.emitter.staticFunctionAccess(member)));
410 } 410 }
411 411
412 var map = new jsAst.ObjectInitializer(properties); 412 var map = new jsAst.ObjectInitializer(properties);
413 elements.add(map); 413 elements.add(map);
414 } 414 }
415 } 415 }
416 416
417 return new jsAst.ArrayInitializer(elements); 417 return new jsAst.ArrayInitializer(elements);
418 } 418 }
419 } 419 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698