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

Side by Side Diff: tool/input_sdk/lib/js/dart2js/js_dart2js.dart

Issue 1933383002: Workaround #537 (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /** 5 /**
6 * Support for interoperating with JavaScript. 6 * Support for interoperating with JavaScript.
7 * 7 *
8 * This library provides access to JavaScript objects from Dart, allowing 8 * This library provides access to JavaScript objects from Dart, allowing
9 * Dart code to get and set properties, and call methods of JavaScript objects 9 * Dart code to get and set properties, and call methods of JavaScript objects
10 * and invoke JavaScript functions. The library takes care of converting 10 * and invoke JavaScript functions. The library takes care of converting
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 args == null ? null : new List.from(args.map(_convertToJS)))); 310 args == null ? null : new List.from(args.map(_convertToJS))));
311 } 311 }
312 312
313 // TODO(jmesserly): this is totally unnecessary in dev_compiler. 313 // TODO(jmesserly): this is totally unnecessary in dev_compiler.
314 /** A [List] that proxies a JavaScript array. */ 314 /** A [List] that proxies a JavaScript array. */
315 class JsArray<E> extends JsObject with ListMixin<E> { 315 class JsArray<E> extends JsObject with ListMixin<E> {
316 316
317 /** 317 /**
318 * Creates a new JavaScript array. 318 * Creates a new JavaScript array.
319 */ 319 */
320 JsArray() : super._fromJs([]); 320 // TODO(vsm): Making this a factory to workaround #537.
321 factory JsArray() { return new JsArray._fromJs([]); }
321 322
322 /** 323 /**
323 * Creates a new JavaScript array and initializes it to the contents of 324 * Creates a new JavaScript array and initializes it to the contents of
324 * [other]. 325 * [other].
325 */ 326 */
326 JsArray.from(Iterable<E> other) 327 JsArray.from(Iterable<E> other)
327 : super._fromJs([]..addAll(other.map(_convertToJS))); 328 : super._fromJs([]..addAll(other.map(_convertToJS)));
328 329
329 JsArray._fromJs(jsObject) : super._fromJs(jsObject); 330 JsArray._fromJs(jsObject) : super._fromJs(jsObject);
330 331
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 ' for (let arg of arguments) {' 551 ' for (let arg of arguments) {'
551 ' args.push(arg);' 552 ' args.push(arg);'
552 ' }' 553 ' }'
553 ' return #(...args);' 554 ' return #(...args);'
554 '}', 555 '}',
555 f); 556 f);
556 _interopCaptureThisExpando[f] = ret; 557 _interopCaptureThisExpando[f] = ret;
557 } 558 }
558 return ret; 559 return ret;
559 } 560 }
OLDNEW
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698