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 4bd7279dea509a1dab4397a3a9d88d2121f87e69..7d6572c5d0275b1e731f580c5d5d84cca25a9180 100644 |
--- a/tools/dom/templates/html/dartium/html_dartium.darttemplate |
+++ b/tools/dom/templates/html/dartium/html_dartium.darttemplate |
@@ -415,12 +415,17 @@ wrap_jso(jsObject) { |
} |
var constructor = js.JsNative.getProperty(jsObject, 'constructor'); |
- if (__interop_checks) { |
- debug_or_assert("constructor != null", constructor != null); |
+ if (constructor == null) { |
+ // Perfectly valid case for JavaScript objects where __proto__ has |
+ // intentionally been set to null. |
+ js.setDartHtmlWrapperFor(jsObject, jsObject); |
+ return jsObject; |
} |
var jsTypeName = js.JsNative.getProperty(constructor, 'name'); |
- if (__interop_checks) { |
- debug_or_assert("constructor != null && jsTypeName.length > 0", constructor != null && jsTypeName.length > 0); |
+ if (jsTypeName is! String || jsTypeName.length == 0) { |
+ // Not an html type. |
+ js.setDartHtmlWrapperFor(jsObject, jsObject); |
+ return jsObject; |
} |
var dartClass_instance; |
@@ -490,12 +495,17 @@ wrap_jso_no_SerializedScriptvalue(jsObject) { |
} |
var constructor = js.JsNative.getProperty(jsObject, 'constructor'); |
- if (__interop_checks) { |
- debug_or_assert("constructor != null", constructor != null); |
+ if (constructor == null) { |
+ // Perfectly valid case for JavaScript objects where __proto__ has |
+ // intentionally been set to null. |
+ js.setDartHtmlWrapperFor(jsObject, jsObject); |
+ return jsObject; |
} |
var jsTypeName = js.JsNative.getProperty(constructor, 'name'); |
- if (__interop_checks) { |
- debug_or_assert("constructor != null && jsTypeName.length > 0", constructor != null && jsTypeName.length > 0); |
+ if (jsTypeName is! String || jsTypeName.length == 0) { |
+ // Not an html type. |
+ js.setDartHtmlWrapperFor(jsObject, jsObject); |
+ return jsObject; |
} |
var func = getHtmlCreateFunction(jsTypeName); |