| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 $libName."); |
| 410 } | 410 } |
| 411 var className = MirrorSystem.getName(cls.simpleName); | 411 var className = MirrorSystem.getName(cls.simpleName); |
| 412 var createdConstructor = cls.constructors[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 |
| 420 if (createdConstructor.parameters.length > 0) { | 420 if (createdConstructor.parameters.length > 0) { |
| 421 throw new UnsupportedError( | 421 throw new UnsupportedError( |
| 422 'Constructor $className.created must take zero arguments'); | 422 'Constructor $className.created must take zero arguments'); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 _scheduleImmediateHelper._schedule(callback); | 609 _scheduleImmediateHelper._schedule(callback); |
| 610 }; | 610 }; |
| 611 | 611 |
| 612 get _pureIsolateScheduleImmediateClosure => ((void callback()) => | 612 get _pureIsolateScheduleImmediateClosure => ((void callback()) => |
| 613 throw new UnimplementedError("scheduleMicrotask in background isolates " | 613 throw new UnimplementedError("scheduleMicrotask in background isolates " |
| 614 "are not supported in the browser")); | 614 "are not supported in the browser")); |
| 615 | 615 |
| 616 void _initializeCustomElement(Element e) { | 616 void _initializeCustomElement(Element e) { |
| 617 _Utils.initializeCustomElement(e); | 617 _Utils.initializeCustomElement(e); |
| 618 } | 618 } |
| OLD | NEW |