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

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

Issue 1363183003: Redo "dart2js: fix for https://github.com/dart-lang/sdk/issues/24412" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months 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/js_helper.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
index 000753264a5a14a5d0146b9800c9770b9ec1c2c5..e8b0a6bded4316b37da9f1b771d5c253647ef2c7 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
@@ -845,6 +845,7 @@ class Primitives {
/// Returns the type of [object] as a string (including type arguments).
///
/// In minified mode, uses the unminified names if available.
+ @NoInline()
static String objectTypeName(Object object) {
return formatType(_objectRawTypeName(object), getRuntimeTypeInfo(object));
}
@@ -867,9 +868,8 @@ class Primitives {
}
if (name == null ||
- identical(interceptor,
- JS_INTERCEPTOR_CONSTANT(UnknownJavaScriptObject)) ||
- identical(interceptor, JS_INTERCEPTOR_CONSTANT(Interceptor))) {
+ identical(interceptor, JS_INTERCEPTOR_CONSTANT(Interceptor)) ||
+ object is UnknownJavaScriptObject) {
// Try to do better. If we do not find something better, leave the name
// as 'UnknownJavaScriptObject' or 'Interceptor' (or the minified name).
//
@@ -885,7 +885,6 @@ class Primitives {
// Try the [constructorNameFallback]. This gets the constructor name for
// any browser (used by [getNativeInterceptor]).
String dispatchName = constructorNameFallback(object);
- if (name == null) name = dispatchName;
if (dispatchName == 'Object') {
// Try to decompile the constructor by turning it into a string and get
// the name out of that. If the decompiled name is a string containing
@@ -900,11 +899,16 @@ class Primitives {
name = decompiledName;
}
}
+ if (name == null) name = dispatchName;
} else {
name = dispatchName;
}
}
+ // Type inference does not understand that [name] is now always a non-null
+ // String. (There is some imprecision in the negation of the disjunction.)
+ name = JS('String', '#', name);
+
// TODO(kasperl): If the namer gave us a fresh global name, we may
// want to remove the numeric suffix that makes it unique too.
if (name.length > 1 && identical(name.codeUnitAt(0), DOLLAR_CHAR_VALUE)) {
« 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