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

Unified Diff: src/messages.js

Issue 11598011: Make sure error message formatting does not have side effects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « no previous file | test/mjsunit/error-tostring.js » ('j') | 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 2cb778fc13c1fbc7b2e7991acda618f9389430ac..0bfaf6c6118f636e45a029d0e5dabc4ec02c3ae5 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -192,7 +192,7 @@ function NoSideEffectToString(obj) {
if (IS_NULL(obj)) return 'null';
if (IS_FUNCTION(obj)) return %_CallFunction(obj, FunctionToString);
if (IS_OBJECT(obj) && %GetDataProperty(obj, "toString") === ObjectToString) {
- var constructor = obj.constructor;
+ var constructor = %GetDataProperty(obj, "constructor");
if (typeof constructor == "function") {
var constructorName = constructor.name;
if (IS_STRING(constructorName) && constructorName !== "") {
« no previous file with comments | « no previous file | test/mjsunit/error-tostring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698