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

Unified Diff: sdk/lib/html/html_common/conversions.dart

Issue 886673002: Check for null prototype in isJavaScriptSimpleObject (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/html/html_common/conversions.dart
diff --git a/sdk/lib/html/html_common/conversions.dart b/sdk/lib/html/html_common/conversions.dart
index 255b3e5e65140d4161f0a1d88d24d0f22148e214..e34345285492b95fcc1d91e61d78fb447dfea310 100644
--- a/sdk/lib/html/html_common/conversions.dart
+++ b/sdk/lib/html/html_common/conversions.dart
@@ -393,7 +393,8 @@ bool isJavaScriptDate(value) => JS('bool', '# instanceof Date', value);
bool isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value);
bool isJavaScriptArray(value) => JS('bool', '# instanceof Array', value);
bool isJavaScriptSimpleObject(value) =>
- JS('bool', 'Object.getPrototypeOf(#) === Object.prototype', value);
+ JS('bool', 'Object.getPrototypeOf(#) === Object.prototype', value) ||
+ JS('bool', 'Object.getPrototypeOf(#) === null', value);
sra1 2015/01/29 02:32:57 Please CSE, the compiler can't do it: { var pro
Alan Knight 2015/01/29 22:52:44 Done.
bool isImmutableJavaScriptArray(value) =>
JS('bool', r'!!(#.immutable$list)', 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