From: whesse@chromium.org Date: Wed, 15 Oct 2008 10:22:26 +0000 (+0000) Subject: Fixes bug 1426704. X-Git-Tag: upstream/4.7.83~25189 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f12e1204631b6bbc3bc0a2a252fe10621e6e3de8;p=platform%2Fupstream%2Fv8.git Fixes bug 1426704. Constructors no longer print out their source code. They print [native code] instead. Some web applications don't like constructors with complex ToString results. Review URL: http://codereview.chromium.org/7345 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@506 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/runtime.cc b/src/runtime.cc index 74d93de..8e329b0 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -891,10 +891,11 @@ static Object* Runtime_SetCode(Arguments args) { target->shared()->set_length(fun->shared()->length()); target->shared()->set_formal_parameter_count( fun->shared()->formal_parameter_count()); - // Set the source code of the target function. - target->shared()->set_script(fun->shared()->script()); - target->shared()->set_start_position(fun->shared()->start_position()); - target->shared()->set_end_position(fun->shared()->end_position()); + // Set the source code of the target function to undefined. + // SetCode is only used for built-in constructors like String, + // Array, and Object, and some web code + // doesn't like seeing source code for constructors. + target->shared()->set_script(Heap::undefined_value()); context = Handle(fun->context()); // Make sure we get a fresh copy of the literal vector to avoid