| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.full_emitter.nsm_emitter; | 5 library dart2js.js_emitter.full_emitter.nsm_emitter; |
| 6 | 6 |
| 7 import '../../elements/entities.dart'; | 7 import '../../elements/entities.dart'; |
| 8 import '../../js/js.dart' as jsAst; | 8 import '../../js/js.dart' as jsAst; |
| 9 import '../../js/js.dart' show js; | 9 import '../../js/js.dart' show js; |
| 10 import '../../js_backend/js_backend.dart' show GetterName, SetterName; | 10 import '../../js_backend/js_backend.dart' show GetterName, SetterName; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 int type = selector.invocationMirrorKind; | 69 int type = selector.invocationMirrorKind; |
| 70 if (!haveVeryFewNoSuchMemberHandlers && | 70 if (!haveVeryFewNoSuchMemberHandlers && |
| 71 isTrivialNsmHandler(type, argNames, selector, jsName) && | 71 isTrivialNsmHandler(type, argNames, selector, jsName) && |
| 72 reflectionName == null) { | 72 reflectionName == null) { |
| 73 trivialNsmHandlers.add(selector); | 73 trivialNsmHandlers.add(selector); |
| 74 } else { | 74 } else { |
| 75 StubMethod method = | 75 StubMethod method = |
| 76 generator.generateStubForNoSuchMethod(jsName, selector); | 76 generator.generateStubForNoSuchMethod(jsName, selector); |
| 77 addProperty(method.name, method.code); | 77 addProperty(method.name, method.code); |
| 78 if (reflectionName != null) { | 78 if (reflectionName != null) { |
| 79 bool accessible = closedWorld.allFunctions | 79 bool accessible = closedWorld |
| 80 .filter(selector, null) | 80 .locateMembers(selector, null) |
| 81 .any(backend.mirrorsData.isMemberAccessibleByReflection); | 81 .any(backend.mirrorsData.isMemberAccessibleByReflection); |
| 82 addProperty( | 82 addProperty( |
| 83 namer.asName('+$reflectionName'), js(accessible ? '2' : '0')); | 83 namer.asName('+$reflectionName'), js(accessible ? '2' : '0')); |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Identify the noSuchMethod handlers that are so simple that we can | 89 // Identify the noSuchMethod handlers that are so simple that we can |
| 90 // generate them programatically. | 90 // generate them programatically. |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 408 } |
| 409 | 409 |
| 410 String get value { | 410 String get value { |
| 411 if (_cachedValue == null) { | 411 if (_cachedValue == null) { |
| 412 _cachedValue = _computeDiffEncoding(); | 412 _cachedValue = _computeDiffEncoding(); |
| 413 } | 413 } |
| 414 | 414 |
| 415 return _cachedValue; | 415 return _cachedValue; |
| 416 } | 416 } |
| 417 } | 417 } |
| OLD | NEW |