Reorder Error properties.

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/717573006

Cr-Commit-Position: refs/heads/master@{#25282}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25282 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yangguo@chromium.org 2014-11-12 09:28:17 +00:00
parent e1c9e732d3
commit ebbcbf1646

View File

@ -1221,13 +1221,13 @@ function SetUpError() {
%AddNamedProperty(f.prototype, "name", name, DONT_ENUM);
%SetCode(f, function(m) {
if (%_IsConstructCall()) {
try { captureStackTrace(this, f); } catch (e) { }
// Define all the expected properties directly on the error
// object. This avoids going through getters and setters defined
// on prototype objects.
if (!IS_UNDEFINED(m)) {
%AddNamedProperty(this, 'message', ToString(m), DONT_ENUM);
}
try { captureStackTrace(this, f); } catch (e) { }
} else {
return new f(m);
}