| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 class NativeEmitter { | 7 class NativeEmitter { |
| 8 | 8 |
| 9 final Map<Element, ClassBuilder> cachedBuilders; | 9 final Map<Element, ClassBuilder> cachedBuilders; |
| 10 | 10 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 bool isTrivialClass(Class cls) { | 261 bool isTrivialClass(Class cls) { |
| 262 bool needsAccessor(Field field) { | 262 bool needsAccessor(Field field) { |
| 263 return field.needsGetter || | 263 return field.needsGetter || |
| 264 field.needsUncheckedSetter || | 264 field.needsUncheckedSetter || |
| 265 field.needsCheckedSetter; | 265 field.needsCheckedSetter; |
| 266 } | 266 } |
| 267 | 267 |
| 268 return | 268 return |
| 269 cls.methods.isEmpty && | 269 cls.methods.isEmpty && |
| 270 cls.isChecks.isEmpty && | 270 cls.isChecks.isEmpty && |
| 271 cls.callStubs.isEmpty && | 271 cls.stubs.isEmpty && |
| 272 !cls.superclass.isMixinApplication && | 272 !cls.superclass.isMixinApplication && |
| 273 !cls.fields.any(needsAccessor); | 273 !cls.fields.any(needsAccessor); |
| 274 } | 274 } |
| 275 | 275 |
| 276 void potentiallyConvertDartClosuresToJs( | 276 void potentiallyConvertDartClosuresToJs( |
| 277 List<jsAst.Statement> statements, | 277 List<jsAst.Statement> statements, |
| 278 FunctionElement member, | 278 FunctionElement member, |
| 279 List<jsAst.Parameter> stubParameters) { | 279 List<jsAst.Parameter> stubParameters) { |
| 280 FunctionSignature parameters = member.functionSignature; | 280 FunctionSignature parameters = member.functionSignature; |
| 281 Element converter = backend.findHelper('convertDartClosureToJS'); | 281 Element converter = backend.findHelper('convertDartClosureToJS'); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 } | 471 } |
| 472 ''', {'info': infoAccess, | 472 ''', {'info': infoAccess, |
| 473 'constructor': constructorAccess, | 473 'constructor': constructorAccess, |
| 474 'subclassRead': subclassRead, | 474 'subclassRead': subclassRead, |
| 475 'interceptorsByTagAccess': interceptorsByTagAccess, | 475 'interceptorsByTagAccess': interceptorsByTagAccess, |
| 476 'leafTagsAccess': leafTagsAccess, | 476 'leafTagsAccess': leafTagsAccess, |
| 477 'nativeSuperclassTagName': embeddedNames.NATIVE_SUPERCLASS_TAG_NAME, | 477 'nativeSuperclassTagName': embeddedNames.NATIVE_SUPERCLASS_TAG_NAME, |
| 478 'allowNativesSubclassing': true}); | 478 'allowNativesSubclassing': true}); |
| 479 } | 479 } |
| 480 } | 480 } |
| OLD | NEW |