| OLD | NEW |
| 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.new_js_emitter.model_emitter; | 5 library dart2js.new_js_emitter.model_emitter; |
| 6 | 6 |
| 7 import '../../dart2jslib.dart' show Compiler; | 7 import '../../dart2jslib.dart' show Compiler; |
| 8 import '../../js/js.dart' as js; | 8 import '../../js/js.dart' as js; |
| 9 import '../../js_backend/js_backend.dart' show | 9 import '../../js_backend/js_backend.dart' show |
| 10 JavaScriptBackend, | 10 JavaScriptBackend, |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 } | 397 } |
| 398 Iterable<Method> methods = cls.methods.expand((Method method) { | 398 Iterable<Method> methods = cls.methods.expand((Method method) { |
| 399 // TODO(floitsch): can there be anything else than a DartMethod? | 399 // TODO(floitsch): can there be anything else than a DartMethod? |
| 400 if (method is DartMethod) { | 400 if (method is DartMethod) { |
| 401 return [method]..addAll(method.parameterStubs); | 401 return [method]..addAll(method.parameterStubs); |
| 402 } else { | 402 } else { |
| 403 return [method]; | 403 return [method]; |
| 404 } | 404 } |
| 405 }); | 405 }); |
| 406 Iterable<Method> isChecks = cls.isChecks; | 406 Iterable<Method> isChecks = cls.isChecks; |
| 407 Iterable<Method> stubs = cls.stubs; | 407 Iterable<Method> callStubs = cls.callStubs; |
| 408 Iterable<Method> noSuchMethodStubs = cls.noSuchMethodStubs; |
| 408 Iterable<Method> gettersSetters = _generateGettersSetters(cls); | 409 Iterable<Method> gettersSetters = _generateGettersSetters(cls); |
| 409 Iterable<Method> allMethods = | 410 Iterable<Method> allMethods = |
| 410 [methods, isChecks, stubs, gettersSetters].expand((x) => x); | 411 [methods, isChecks, callStubs, noSuchMethodStubs, gettersSetters] |
| 412 .expand((x) => x); |
| 411 elements.addAll(allMethods.expand((e) => [js.string(e.name), e.code])); | 413 elements.addAll(allMethods.expand((e) => [js.string(e.name), e.code])); |
| 412 return unparse(compiler, new js.ArrayInitializer(elements)); | 414 return unparse(compiler, new js.ArrayInitializer(elements)); |
| 413 } | 415 } |
| 414 | 416 |
| 415 js.Expression emitLazyInitializer(StaticField field) { | 417 js.Expression emitLazyInitializer(StaticField field) { |
| 416 assert(field.isLazy); | 418 assert(field.isLazy); |
| 417 return unparse(compiler, field.code); | 419 return unparse(compiler, field.code); |
| 418 } | 420 } |
| 419 | 421 |
| 420 Iterable<js.Expression> emitStaticMethod(StaticMethod method) { | 422 Iterable<js.Expression> emitStaticMethod(StaticMethod method) { |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 | 626 |
| 625 var end = Date.now(); | 627 var end = Date.now(); |
| 626 print('Setup: ' + (end - start) + ' ms.'); | 628 print('Setup: ' + (end - start) + ' ms.'); |
| 627 | 629 |
| 628 #main(); // Start main. | 630 #main(); // Start main. |
| 629 | 631 |
| 630 }(Date.now(), #code) | 632 }(Date.now(), #code) |
| 631 }"""; | 633 }"""; |
| 632 | 634 |
| 633 } | 635 } |
| OLD | NEW |