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 // WARNING: Do not edit - generated code. | 5 // WARNING: Do not edit - generated code. |
6 | 6 |
7 part of $LIBRARYNAME; | 7 part of $LIBRARYNAME; |
8 | 8 |
9 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
{ | 9 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
{ |
10 $!MEMBERS | 10 $!MEMBERS |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // | 303 // |
304 // sanitizing causes custom element to created recursively | 304 // sanitizing causes custom element to created recursively |
305 // until stack overflow. | 305 // until stack overflow. |
306 // | 306 // |
307 // See https://github.com/dart-lang/sdk/issues/23666 | 307 // See https://github.com/dart-lang/sdk/issues/23666 |
308 int creating = 0; | 308 int creating = 0; |
309 elemProto['createdCallback'] = new js.JsFunction.withThis(($this) { | 309 elemProto['createdCallback'] = new js.JsFunction.withThis(($this) { |
310 if (_getJSClassName(reflectClass(customElementClass).superclass) != null &
& creating < 2) { | 310 if (_getJSClassName(reflectClass(customElementClass).superclass) != null &
& creating < 2) { |
311 creating++; | 311 creating++; |
312 | 312 |
313 var dartClass = _blink.Blink_Utils.constructElement(customElementClass,
$this); | 313 var dartClass; |
| 314 try { |
| 315 dartClass = _blink.Blink_Utils.constructElement(customElementClass, $t
his); |
| 316 } catch (e) { |
| 317 dartClass = null; |
| 318 } finally { |
| 319 // Need to remember the Dart class that was created for this custom so |
| 320 // return it and setup the blink_jsObject to the $this that we'll be w
orking |
| 321 // with as we talk to blink. |
| 322 $this['dart_class'] = dartClass; |
314 | 323 |
315 // Need to remember the Dart class that was created for this custom so | 324 creating--; |
316 // return it and setup the blink_jsObject to the $this that we'll be wor
king | 325 } |
317 // with as we talk to blink. | |
318 $this['dart_class'] = dartClass; | |
319 | |
320 creating--; | |
321 } | 326 } |
322 }); | 327 }); |
323 elemProto['attributeChangedCallback'] = new js.JsFunction.withThis(($this, a
ttrName, oldVal, newVal) { | 328 elemProto['attributeChangedCallback'] = new js.JsFunction.withThis(($this, a
ttrName, oldVal, newVal) { |
324 if ($this["dart_class"] != null && $this['dart_class'].attributeChanged !=
null) { | 329 if ($this["dart_class"] != null && $this['dart_class'].attributeChanged !=
null) { |
325 $this['dart_class'].attributeChanged(attrName, oldVal, newVal); | 330 $this['dart_class'].attributeChanged(attrName, oldVal, newVal); |
326 } | 331 } |
327 }); | 332 }); |
328 elemProto['attachedCallback'] = new js.JsFunction.withThis(($this) { | 333 elemProto['attachedCallback'] = new js.JsFunction.withThis(($this) { |
329 if ($this["dart_class"] != null && $this['dart_class'].attached != null) { | 334 if ($this["dart_class"] != null && $this['dart_class'].attached != null) { |
330 $this['dart_class'].attached(); | 335 $this['dart_class'].attached(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 /// parameter must be provided. | 403 /// parameter must be provided. |
399 @Experimental() | 404 @Experimental() |
400 ElementUpgrader createElementUpgrader(Type type, {String extendsTag}) { | 405 ElementUpgrader createElementUpgrader(Type type, {String extendsTag}) { |
401 $if DART2JS | 406 $if DART2JS |
402 return new _JSElementUpgrader(this, type, extendsTag); | 407 return new _JSElementUpgrader(this, type, extendsTag); |
403 $else | 408 $else |
404 return new _VMElementUpgrader(this, type, extendsTag); | 409 return new _VMElementUpgrader(this, type, extendsTag); |
405 $endif | 410 $endif |
406 } | 411 } |
407 } | 412 } |
OLD | NEW |