| 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 LibraryMirror lib = cls.owner; | 399 LibraryMirror lib = cls.owner; |
| 400 String libName = lib.uri.toString(); | 400 String libName = lib.uri.toString(); |
| 401 return libName.startsWith('dart:'); | 401 return libName.startsWith('dart:'); |
| 402 } | 402 } |
| 403 | 403 |
| 404 static void register(Document document, String tag, Type type, | 404 static void register(Document document, String tag, Type type, |
| 405 String extendsTagName) { | 405 String extendsTagName) { |
| 406 // TODO(vsm): Move these checks into native code. | 406 // TODO(vsm): Move these checks into native code. |
| 407 ClassMirror cls = reflectClass(type); | 407 ClassMirror cls = reflectClass(type); |
| 408 if (_isBuiltinType(cls)) { | 408 if (_isBuiltinType(cls)) { |
| 409 throw new UnsupportedError("Invalid custom element from $libName."); | 409 throw new UnsupportedError("Invalid custom element from ${cls.owner.uri}."
); |
| 410 } | 410 } |
| 411 var className = MirrorSystem.getName(cls.simpleName); | 411 var className = MirrorSystem.getName(cls.simpleName); |
| 412 var createdConstructor = cls.declarations[new Symbol('$className.created')]; | 412 var createdConstructor = cls.declarations[new Symbol('$className.created')]; |
| 413 if (createdConstructor == null || | 413 if (createdConstructor == null || |
| 414 createdConstructor is! MethodMirror || | 414 createdConstructor is! MethodMirror || |
| 415 !createdConstructor.isConstructor) { | 415 !createdConstructor.isConstructor) { |
| 416 throw new UnsupportedError( | 416 throw new UnsupportedError( |
| 417 'Class is missing constructor $className.created'); | 417 'Class is missing constructor $className.created'); |
| 418 } | 418 } |
| 419 | 419 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 void operator []=(String key, String value) native "DOMStringMap_setItem_Callb
ack"; | 506 void operator []=(String key, String value) native "DOMStringMap_setItem_Callb
ack"; |
| 507 String putIfAbsent(String key, String ifAbsent()) => Maps.putIfAbsent(this, ke
y, ifAbsent); | 507 String putIfAbsent(String key, String ifAbsent()) => Maps.putIfAbsent(this, ke
y, ifAbsent); |
| 508 String remove(String key) native "DOMStringMap_remove_Callback"; | 508 String remove(String key) native "DOMStringMap_remove_Callback"; |
| 509 void clear() => Maps.clear(this); | 509 void clear() => Maps.clear(this); |
| 510 void forEach(void f(String key, String value)) => Maps.forEach(this, f); | 510 void forEach(void f(String key, String value)) => Maps.forEach(this, f); |
| 511 Iterable<String> get keys native "DOMStringMap_getKeys_Callback"; | 511 Iterable<String> get keys native "DOMStringMap_getKeys_Callback"; |
| 512 Iterable<String> get values => Maps.getValues(this); | 512 Iterable<String> get values => Maps.getValues(this); |
| 513 int get length => Maps.length(this); | 513 int get length => Maps.length(this); |
| 514 bool get isEmpty => Maps.isEmpty(this); | 514 bool get isEmpty => Maps.isEmpty(this); |
| 515 bool get isNotEmpty => Maps.isNotEmpty(this); | 515 bool get isNotEmpty => Maps.isNotEmpty(this); |
| 516 void addAll(Map<String, String> other) { |
| 517 other.forEach((key, value) => this[key] = value); |
| 518 } |
| 516 } | 519 } |
| 517 | 520 |
| 518 final _printClosure = window.console.log; | 521 final _printClosure = window.console.log; |
| 519 final _pureIsolatePrintClosure = (s) { | 522 final _pureIsolatePrintClosure = (s) { |
| 520 throw new UnimplementedError("Printing from a background isolate " | 523 throw new UnimplementedError("Printing from a background isolate " |
| 521 "is not supported in the browser"); | 524 "is not supported in the browser"); |
| 522 }; | 525 }; |
| 523 | 526 |
| 524 final _forwardingPrintClosure = _Utils.forwardingPrint; | 527 final _forwardingPrintClosure = _Utils.forwardingPrint; |
| 525 | 528 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 _scheduleImmediateHelper._schedule(callback); | 615 _scheduleImmediateHelper._schedule(callback); |
| 613 }; | 616 }; |
| 614 | 617 |
| 615 get _pureIsolateScheduleImmediateClosure => ((void callback()) => | 618 get _pureIsolateScheduleImmediateClosure => ((void callback()) => |
| 616 throw new UnimplementedError("scheduleMicrotask in background isolates " | 619 throw new UnimplementedError("scheduleMicrotask in background isolates " |
| 617 "are not supported in the browser")); | 620 "are not supported in the browser")); |
| 618 | 621 |
| 619 void _initializeCustomElement(Element e) { | 622 void _initializeCustomElement(Element e) { |
| 620 _Utils.initializeCustomElement(e); | 623 _Utils.initializeCustomElement(e); |
| 621 } | 624 } |
| OLD | NEW |