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

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

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.dart
===================================================================
--- compiler/lib/implementation/string.dart (revision 400)
+++ compiler/lib/implementation/string.dart (working copy)
@@ -145,7 +145,8 @@
while (ix < str.length) {
int foundIx = str.indexOf(this, ix);
if (foundIx < 0) break;
- result.add(new _StringMatch(foundIx, str, this));
+ // call "toString" to coerse the "this" back to a primitive string
floitsch 2011/10/14 20:20:44 Call ... coerce ... string. (finish with dot).
John Lenz 2011/10/14 21:26:40 Done.
+ result.add(new _StringMatch(foundIx, str, this.toString()));
ix = foundIx + length;
}
return result;
@@ -184,6 +185,8 @@
String _replace(Pattern from, String to) native;
String _replaceAll(Pattern from, String to) native;
Array<String> _split(Pattern pattern) native;
+
+ get dynamic() { return toString(); }
}
class _StringJsUtil {

Powered by Google App Engine
This is Rietveld 408576698