| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 if (mirror is MethodMirror && mirror.isSetter) | 295 if (mirror is MethodMirror && mirror.isSetter) |
| 296 name = name.substring(0, name.length - 1); | 296 name = name.substring(0, name.length - 1); |
| 297 completions.add(name); | 297 completions.add(name); |
| 298 } | 298 } |
| 299 }); | 299 }); |
| 300 } | 300 } |
| 301 | 301 |
| 302 addForClass(ClassMirror mirror, bool isStatic) { | 302 addForClass(ClassMirror mirror, bool isStatic) { |
| 303 if (mirror == null) | 303 if (mirror == null) |
| 304 return; | 304 return; |
| 305 addAll(mirror.members, isStatic); | 305 addAll(mirror.declarations, isStatic); |
| 306 if (mirror.superclass != null) | 306 if (mirror.superclass != null) |
| 307 addForClass(mirror.superclass, isStatic); | 307 addForClass(mirror.superclass, isStatic); |
| 308 for (var interface in mirror.superinterfaces) { | 308 for (var interface in mirror.superinterfaces) { |
| 309 addForClass(interface, isStatic); | 309 addForClass(interface, isStatic); |
| 310 } | 310 } |
| 311 } | 311 } |
| 312 | 312 |
| 313 if (o is Type) { | 313 if (o is Type) { |
| 314 addForClass(reflectClass(o), true); | 314 addForClass(reflectClass(o), true); |
| 315 } else { | 315 } else { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 | 416 |
| 417 static void register(Document document, String tag, Type type, | 417 static void register(Document document, String tag, Type type, |
| 418 String extendsTagName) { | 418 String extendsTagName) { |
| 419 // TODO(vsm): Move these checks into native code. | 419 // TODO(vsm): Move these checks into native code. |
| 420 ClassMirror cls = reflectClass(type); | 420 ClassMirror cls = reflectClass(type); |
| 421 if (_isBuiltinType(cls)) { | 421 if (_isBuiltinType(cls)) { |
| 422 throw new UnsupportedError("Invalid custom element from $libName."); | 422 throw new UnsupportedError("Invalid custom element from $libName."); |
| 423 } | 423 } |
| 424 var className = MirrorSystem.getName(cls.simpleName); | 424 var className = MirrorSystem.getName(cls.simpleName); |
| 425 var createdConstructor = cls.constructors[new Symbol('$className.created')]; | 425 var createdConstructor = cls.constructors[new Symbol('$className.created')]; |
| 426 if (createdConstructor == null) { | 426 if (createdConstructor == null || |
| 427 createdConstructor is! MethodMirror || |
| 428 !createdConstructor.isConstructor) { |
| 427 throw new UnsupportedError( | 429 throw new UnsupportedError( |
| 428 'Class is missing constructor $className.created'); | 430 'Class is missing constructor $className.created'); |
| 429 } | 431 } |
| 430 | 432 |
| 431 if (createdConstructor.parameters.length > 0) { | 433 if (createdConstructor.parameters.length > 0) { |
| 432 throw new UnsupportedError( | 434 throw new UnsupportedError( |
| 433 'Constructor $className.created must take zero arguments'); | 435 'Constructor $className.created must take zero arguments'); |
| 434 } | 436 } |
| 435 | 437 |
| 436 Symbol objectName = reflectClass(Object).qualifiedName; | 438 Symbol objectName = reflectClass(Object).qualifiedName; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 _scheduleImmediateHelper._schedule(callback); | 622 _scheduleImmediateHelper._schedule(callback); |
| 621 }; | 623 }; |
| 622 | 624 |
| 623 get _pureIsolateScheduleImmediateClosure => ((void callback()) => | 625 get _pureIsolateScheduleImmediateClosure => ((void callback()) => |
| 624 throw new UnimplementedError("scheduleMicrotask in background isolates " | 626 throw new UnimplementedError("scheduleMicrotask in background isolates " |
| 625 "are not supported in the browser")); | 627 "are not supported in the browser")); |
| 626 | 628 |
| 627 void _initializeCustomElement(Element e) { | 629 void _initializeCustomElement(Element e) { |
| 628 _Utils.initializeCustomElement(e); | 630 _Utils.initializeCustomElement(e); |
| 629 } | 631 } |
| OLD | NEW |