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

Unified Diff: src/messages.js

Issue 649203004: Fix NoSideEffectToString. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index 2dddffa57ad8cae08d6f445116558dac18e7d4a4..9d67d9ca4e216d8d72ac3e702e8e71cbfce52810 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -223,7 +223,10 @@ function NoSideEffectToString(obj) {
return str;
}
if (IS_SYMBOL(obj)) return %_CallFunction(obj, SymbolToString);
- if (IS_OBJECT(obj) && %GetDataProperty(obj, "toString") === ObjectToString) {
+ if (CanBeSafelyTreatedAsAnErrorObject(obj)) {
+ return %_CallFunction(obj, ErrorToString);
+ }
+ if (IS_OBJECT(obj)) {
caitp (gmail) 2014/10/21 01:09:37 So, this will cause arrays to always be reported a
var constructor = %GetDataProperty(obj, "constructor");
if (typeof constructor == "function") {
var constructorName = constructor.name;
@@ -232,9 +235,6 @@ function NoSideEffectToString(obj) {
}
}
}
- if (CanBeSafelyTreatedAsAnErrorObject(obj)) {
- return %_CallFunction(obj, ErrorToString);
- }
return %_CallFunction(obj, ObjectToString);
}
« 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