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

Unified Diff: sdk/lib/_internal/js_runtime/lib/native_helper.dart

Issue 2492163002: Avoid using constructor.name on ff & safari (Closed)
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/native_helper.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/native_helper.dart b/sdk/lib/_internal/js_runtime/lib/native_helper.dart
index c6aad9430c4302c697a8244b7b667d39de0029fd..d3ef5f200042fea09e353fee897013e39e92a27e 100644
--- a/sdk/lib/_internal/js_runtime/lib/native_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/native_helper.dart
@@ -497,30 +497,6 @@ function() {
*/
const _constructorNameFallback = const JS_CONST(r'''
function getTagFallback(o) {
- var constructor = o.constructor;
- if (typeof constructor == "function") {
- var name = constructor.name;
- // If the name is a non-empty string, we use that as the type name of this
- // object. There are various cases where that does not work, so we have to
- // detect them and fall through to the toString() based implementation.
-
- if (typeof name == "string" &&
-
- // Sometimes the string is empty. This test also catches minified
- // shadow dom polyfil wrapper for Window on Firefox where the faked
- // constructor name does not 'stick'. The shortest real DOM object
- // names have three characters (e.g. URL, CSS).
- name.length > 2 &&
-
- // On Firefox we often get "Object" as the constructor name, even for
- // more specialized DOM objects.
- name !== "Object" &&
-
- // This can happen in Opera.
- name !== "Function.prototype") {
- return name;
- }
- }
var s = Object.prototype.toString.call(o);
return s.substring(8, s.length - 1);
}''');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698