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 html; | 5 part of html; |
6 | 6 |
7 class _ConsoleVariables { | 7 class _ConsoleVariables { |
8 Map<String, Object> _data = new Map<String, Object>(); | 8 Map<String, Object> _data = new Map<String, Object>(); |
9 | 9 |
10 /** | 10 /** |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 * This method is used as Library prefixes include a trailing dot when using | 383 * This method is used as Library prefixes include a trailing dot when using |
384 * the C Dart debugger API. | 384 * the C Dart debugger API. |
385 */ | 385 */ |
386 static String stripTrailingDot(String str) => | 386 static String stripTrailingDot(String str) => |
387 (str != null && str[str.length - 1] == '.') ? str.substring(0, str.length -
1) : str; | 387 (str != null && str[str.length - 1] == '.') ? str.substring(0, str.length -
1) : str; |
388 | 388 |
389 static String addTrailingDot(String str) => '${str}.'; | 389 static String addTrailingDot(String str) => '${str}.'; |
390 | 390 |
391 static bool isNoSuchMethodError(obj) => obj is NoSuchMethodError; | 391 static bool isNoSuchMethodError(obj) => obj is NoSuchMethodError; |
392 | 392 |
393 // TODO(jacobr): we need a failsafe way to determine that a Node is really a | |
394 // DOM node rather than just a class that extends Node. | |
395 static bool isNode(obj) => obj is Node; | |
396 | |
397 static bool _isBuiltinType(ClassMirror cls) { | 393 static bool _isBuiltinType(ClassMirror cls) { |
398 // TODO(vsm): Find a less hackish way to do this. | 394 // TODO(vsm): Find a less hackish way to do this. |
399 LibraryMirror lib = cls.owner; | 395 LibraryMirror lib = cls.owner; |
400 String libName = lib.uri.toString(); | 396 String libName = lib.uri.toString(); |
401 return libName.startsWith('dart:'); | 397 return libName.startsWith('dart:'); |
402 } | 398 } |
403 | 399 |
404 static void register(Document document, String tag, Type type, | 400 static void register(Document document, String tag, Type type, |
405 String extendsTagName) { | 401 String extendsTagName) { |
406 // TODO(vsm): Move these checks into native code. | 402 // TODO(vsm): Move these checks into native code. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 }; | 523 }; |
528 | 524 |
529 get _pureIsolateTimerFactoryClosure => | 525 get _pureIsolateTimerFactoryClosure => |
530 ((int milliSeconds, void callback(Timer time), bool repeating) => | 526 ((int milliSeconds, void callback(Timer time), bool repeating) => |
531 throw new UnimplementedError("Timers on background isolates " | 527 throw new UnimplementedError("Timers on background isolates " |
532 "are not supported in the browser")); | 528 "are not supported in the browser")); |
533 | 529 |
534 void _initializeCustomElement(Element e) { | 530 void _initializeCustomElement(Element e) { |
535 _Utils.initializeCustomElement(e); | 531 _Utils.initializeCustomElement(e); |
536 } | 532 } |
OLD | NEW |