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

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

Issue 8323001: By pass object boxing for all js primitives. (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
« 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: compiler/lib/implementation/core.js
===================================================================
--- compiler/lib/implementation/core.js (revision 471)
+++ compiler/lib/implementation/core.js (working copy)
@@ -302,11 +302,11 @@
function EQ$operator(val1, val2) {
if (val1 === $Dart$Null) {
return val2 === $Dart$Null;
- } else {
- return (typeof(val1) == 'number' && typeof(val2) == 'number')
- ? val1 == val2
- : val1.EQ$operator(val2);
- }
+ } else if (typeof(val1) == typeof(val2) && typeof val1 != 'object') {
+ // number, boolean, string
+ return val1 === val2;
+ }
+ return val1.EQ$operator(val2);
}
function NE$operator(val1, val2) {
« 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