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

Unified Diff: src/runtime.js

Issue 6062002: Merge 6006:6095 from bleeding_edge to experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 10 years 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 | « src/runtime.cc ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.js
===================================================================
--- src/runtime.js (revision 6095)
+++ src/runtime.js (working copy)
@@ -594,13 +594,15 @@
// ECMA-262, section 8.6.2.6, page 28.
function DefaultNumber(x) {
- if (IS_FUNCTION(x.valueOf)) {
- var v = x.valueOf();
+ var valueOf = x.valueOf;
+ if (IS_FUNCTION(valueOf)) {
+ var v = %_CallFunction(x, valueOf);
if (%IsPrimitive(v)) return v;
}
- if (IS_FUNCTION(x.toString)) {
- var s = x.toString();
+ var toString = x.toString;
+ if (IS_FUNCTION(toString)) {
+ var s = %_CallFunction(x, toString);
if (%IsPrimitive(s)) return s;
}
@@ -610,13 +612,15 @@
// ECMA-262, section 8.6.2.6, page 28.
function DefaultString(x) {
- if (IS_FUNCTION(x.toString)) {
- var s = x.toString();
+ var toString = x.toString;
+ if (IS_FUNCTION(toString)) {
+ var s = %_CallFunction(x, toString);
if (%IsPrimitive(s)) return s;
}
- if (IS_FUNCTION(x.valueOf)) {
- var v = x.valueOf();
+ var valueOf = x.valueOf;
+ if (IS_FUNCTION(valueOf)) {
+ var v = %_CallFunction(x, valueOf);
if (%IsPrimitive(v)) return v;
}
« no previous file with comments | « src/runtime.cc ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698