| 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 _js_helper; | 5 library _js_helper; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:_isolate_helper' show | 8 import 'dart:_isolate_helper' show |
| 9 IsolateNatives, | 9 IsolateNatives, |
| 10 leaveJsAsync, | 10 leaveJsAsync, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return _memberName; | 143 return _memberName; |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool get isMethod => _kind == METHOD; | 146 bool get isMethod => _kind == METHOD; |
| 147 bool get isGetter => _kind == GETTER; | 147 bool get isGetter => _kind == GETTER; |
| 148 bool get isSetter => _kind == SETTER; | 148 bool get isSetter => _kind == SETTER; |
| 149 bool get isAccessor => _kind != METHOD; | 149 bool get isAccessor => _kind != METHOD; |
| 150 | 150 |
| 151 List get positionalArguments { | 151 List get positionalArguments { |
| 152 if (isGetter) return const []; | 152 if (isGetter) return const []; |
| 153 var argumentCount = _arguments.length - _namedArgumentNames.length; | 153 var argumentCount = |
| 154 _arguments.length - _namedArgumentNames.length; |
| 154 if (argumentCount == 0) return const []; | 155 if (argumentCount == 0) return const []; |
| 155 var list = []; | 156 var list = []; |
| 156 for (var index = 0 ; index < argumentCount ; index++) { | 157 for (var index = 0 ; index < argumentCount ; index++) { |
| 157 list.add(_arguments[index]); | 158 list.add(_arguments[index]); |
| 158 } | 159 } |
| 159 return makeLiteralListConst(list); | 160 return makeLiteralListConst(list); |
| 160 } | 161 } |
| 161 | 162 |
| 162 Map<Symbol, dynamic> get namedArguments { | 163 Map<Symbol, dynamic> get namedArguments { |
| 163 // TODO: Make maps const (issue 10471) | 164 // TODO: Make maps const (issue 10471) |
| (...skipping 3155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3319 JS('', '#.addEventListener("error", #, false)', | 3320 JS('', '#.addEventListener("error", #, false)', |
| 3320 script, convertDartClosureToJS((event) { | 3321 script, convertDartClosureToJS((event) { |
| 3321 completer.completeError( | 3322 completer.completeError( |
| 3322 new DeferredLoadException("Loading $uri failed.")); | 3323 new DeferredLoadException("Loading $uri failed.")); |
| 3323 }, 1)); | 3324 }, 1)); |
| 3324 JS('', 'document.body.appendChild(#)', script); | 3325 JS('', 'document.body.appendChild(#)', script); |
| 3325 | 3326 |
| 3326 return completer.future; | 3327 return completer.future; |
| 3327 }); | 3328 }); |
| 3328 } | 3329 } |
| OLD | NEW |