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

Unified Diff: compiler/lib/implementation/string.js

Issue 8286001: Changes "is" and equality checks to strictly check for primitive types, fix a couple of (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 2 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
Index: compiler/lib/implementation/string.js
===================================================================
--- compiler/lib/implementation/string.js (revision 400)
+++ compiler/lib/implementation/string.js (working copy)
@@ -15,14 +15,7 @@
}
function native_StringImplementation_EQ(other) {
- if (typeof other == 'string') {
- return this == other;
- } else if (other instanceof String) {
- // Must convert other to a primitive for value equality to work.
- return this == String(other);
- } else {
- return false;
- }
+ return typeof other == 'string' && this == other;
}
function native_StringImplementation_indexOf(other, startIndex) {
« compiler/lib/implementation/string.dart ('K') | « compiler/lib/implementation/string.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698