Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: tools/dom/templates/html/dartium/html_dartium.darttemplate

Issue 1405963015: Return the real error during custom element created failure (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/dartium/html_dartium.darttemplate
diff --git a/tools/dom/templates/html/dartium/html_dartium.darttemplate b/tools/dom/templates/html/dartium/html_dartium.darttemplate
index 0e029f2a243f6e15b560e085db6ea1fd2ed33447..c82e9b509aed4c60e5785f07ecc9ffcbe88729b1 100644
--- a/tools/dom/templates/html/dartium/html_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/html_dartium.darttemplate
@@ -405,32 +405,6 @@ class DartHtmlDomObject {
}
-/// Upgrade a Dart HtmlElement to the user's Dart custom element class.
-_upgradeHtmlElement(dartInstance) {
- // Only try upgrading HtmlElement (Dart class) if there is a failure then
- // don't try it again - one failure is enough.
- if (dartInstance.runtimeType == HtmlElement && !dartInstance.isBadUpgrade) {
- // Must be exactly HtmlElement not something derived from it.
-
- var customElementClass = getCustomElementType(dartInstance);
-
- // Custom Element to upgrade.
- if (customElementClass != null) {
- var jsObject = dartInstance.blink_jsObject;
- try {
- dartInstance = _blink.Blink_Utils.constructElement(customElementClass, jsObject);
- } catch (e) {
- dartInstance._badUpgrade();
- } finally {
- dartInstance.blink_jsObject = jsObject;
- js.setDartHtmlWrapperFor(jsObject, dartInstance);
- }
- }
- }
-
- return dartInstance;
-}
-
@Deprecated("Internal Use Only")
class DebugAssertException implements Exception {
String message;
@@ -480,7 +454,12 @@ _createCustomUpgrader(Type customElementClass, $this) {
try {
dartClass = _blink.Blink_Utils.constructElement(customElementClass, $this);
} catch (e) {
- dartClass._badUpgrade();
+ // Did the dartClass get allocated but the created failed? Otherwise, other
+ // components inside of this failed somewhere (could be JS custom element).
+ if (dartClass != null) {
+ // Yes, mark as didn't upgrade.
+ dartClass._badUpgrade();
+ }
throw e;
} finally {
// Need to remember the Dart class that was created for this custom so
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698