Diff
Modified: trunk/LayoutTests/ChangeLog (91115 => 91116)
--- trunk/LayoutTests/ChangeLog 2011-07-15 21:57:35 UTC (rev 91115)
+++ trunk/LayoutTests/ChangeLog 2011-07-15 22:03:09 UTC (rev 91116)
@@ -1,3 +1,16 @@
+2011-07-15 Gavin Barraclough <[email protected]>
+
+ NativeError.prototype objects have [[Class]] of "Object" but should be "Error"
+ https://bugs.webkit.org/show_bug.cgi?id=55346
+
+ Reviewed by Sam Weinig.
+
+ Added test case.
+
+ * fast/js/native-error-prototype-expected.txt: Added.
+ * fast/js/native-error-prototype.html: Added.
+ * fast/js/script-tests/native-error-prototype.js: Added.
+
2011-06-27 Adrienne Walker <[email protected]>
Reviewed by Simon Fraser.
Added: trunk/LayoutTests/fast/js/native-error-prototype-expected.txt (0 => 91116)
--- trunk/LayoutTests/fast/js/native-error-prototype-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/js/native-error-prototype-expected.txt 2011-07-15 22:03:09 UTC (rev 91116)
@@ -0,0 +1,11 @@
+This is a test case for bug 55346.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS ({}).toString.call(Error.prototype) is "[object Error]"
+PASS ({}).toString.call(RangeError.prototype) is "[object Error]"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/js/native-error-prototype.html (0 => 91116)
--- trunk/LayoutTests/fast/js/native-error-prototype.html (rev 0)
+++ trunk/LayoutTests/fast/js/native-error-prototype.html 2011-07-15 22:03:09 UTC (rev 91116)
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/js/script-tests/native-error-prototype.js (0 => 91116)
--- trunk/LayoutTests/fast/js/script-tests/native-error-prototype.js (rev 0)
+++ trunk/LayoutTests/fast/js/script-tests/native-error-prototype.js 2011-07-15 22:03:09 UTC (rev 91116)
@@ -0,0 +1,8 @@
+description(
+'This is a test case for <a href="" 55346</a>.'
+);
+
+shouldBe("({}).toString.call(Error.prototype)", '"[object Error]"');
+shouldBe("({}).toString.call(RangeError.prototype)", '"[object Error]"');
+
+var successfullyParsed = true;
Modified: trunk/Source/_javascript_Core/ChangeLog (91115 => 91116)
--- trunk/Source/_javascript_Core/ChangeLog 2011-07-15 21:57:35 UTC (rev 91115)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-07-15 22:03:09 UTC (rev 91116)
@@ -1,5 +1,20 @@
2011-07-15 Gavin Barraclough <[email protected]>
+ NativeError.prototype objects have [[Class]] of "Object" but should be "Error"
+ https://bugs.webkit.org/show_bug.cgi?id=55346
+
+ Reviewed by Sam Weinig.
+
+ * runtime/ErrorPrototype.cpp:
+ (JSC::ErrorPrototype::ErrorPrototype):
+ - Switch to putDirect since we're not the only ones tranitioning this Structure now.
+ * runtime/NativeErrorPrototype.cpp:
+ (JSC::NativeErrorPrototype::NativeErrorPrototype):
+ * runtime/NativeErrorPrototype.h:
+ - Switch base class to ErrorPrototype.
+
+2011-07-15 Gavin Barraclough <[email protected]>
+
DFG JIT - Where arguments passed are integers, speculate this.
https://bugs.webkit.org/show_bug.cgi?id=64630
Modified: trunk/Source/_javascript_Core/runtime/ErrorPrototype.cpp (91115 => 91116)
--- trunk/Source/_javascript_Core/runtime/ErrorPrototype.cpp 2011-07-15 21:57:35 UTC (rev 91115)
+++ trunk/Source/_javascript_Core/runtime/ErrorPrototype.cpp 2011-07-15 22:03:09 UTC (rev 91116)
@@ -53,7 +53,7 @@
ErrorPrototype::ErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
: ErrorInstance(&exec->globalData(), structure)
{
- putDirectWithoutTransition(exec->globalData(), exec->propertyNames().name, jsNontrivialString(exec, "Error"), DontEnum);
+ putDirect(exec->globalData(), exec->propertyNames().name, jsNontrivialString(exec, "Error"), DontEnum);
ASSERT(inherits(&s_info));
putAnonymousValue(globalObject->globalData(), 0, globalObject);
Modified: trunk/Source/_javascript_Core/runtime/NativeErrorPrototype.cpp (91115 => 91116)
--- trunk/Source/_javascript_Core/runtime/NativeErrorPrototype.cpp 2011-07-15 21:57:35 UTC (rev 91115)
+++ trunk/Source/_javascript_Core/runtime/NativeErrorPrototype.cpp 2011-07-15 22:03:09 UTC (rev 91116)
@@ -21,7 +21,6 @@
#include "config.h"
#include "NativeErrorPrototype.h"
-#include "ErrorPrototype.h"
#include "JSGlobalObject.h"
#include "JSString.h"
#include "NativeErrorConstructor.h"
@@ -32,7 +31,7 @@
ASSERT_CLASS_FITS_IN_CELL(NativeErrorPrototype);
NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& nameAndMessage, NativeErrorConstructor* constructor)
- : JSObjectWithGlobalObject(globalObject, structure)
+ : ErrorPrototype(exec, globalObject, structure)
{
putDirect(exec->globalData(), exec->propertyNames().name, jsString(exec, nameAndMessage), DontEnum);
putDirect(exec->globalData(), exec->propertyNames().message, jsString(exec, nameAndMessage), DontEnum);
Modified: trunk/Source/_javascript_Core/runtime/NativeErrorPrototype.h (91115 => 91116)
--- trunk/Source/_javascript_Core/runtime/NativeErrorPrototype.h 2011-07-15 21:57:35 UTC (rev 91115)
+++ trunk/Source/_javascript_Core/runtime/NativeErrorPrototype.h 2011-07-15 22:03:09 UTC (rev 91116)
@@ -21,12 +21,12 @@
#ifndef NativeErrorPrototype_h
#define NativeErrorPrototype_h
-#include "JSObjectWithGlobalObject.h"
+#include "ErrorPrototype.h"
namespace JSC {
class NativeErrorConstructor;
- class NativeErrorPrototype : public JSObjectWithGlobalObject {
+ class NativeErrorPrototype : public ErrorPrototype {
public:
NativeErrorPrototype(ExecState*, JSGlobalObject*, Structure*, const UString&, NativeErrorConstructor*);
};