Title: [127930] trunk
Revision
127930
Author
barraclo...@apple.com
Date
2012-09-07 15:50:45 -0700 (Fri, 07 Sep 2012)

Log Message

Object.prototype.__define{G,S}etter__ with non-callable second parameter should throw TypeError instead of SyntaxError
https://bugs.webkit.org/show_bug.cgi?id=93873

Reviewed by Sam Weinig.

Source/_javascript_Core: 

* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncDefineGetter):
    - throw TypeError instead of SyntaxError
(JSC::objectProtoFuncDefineSetter):
    - throw TypeError instead of SyntaxError

LayoutTests: 

* fast/js/property-getters-and-setters-expected.txt:
    - updated results

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (127929 => 127930)


--- trunk/LayoutTests/ChangeLog	2012-09-07 22:39:15 UTC (rev 127929)
+++ trunk/LayoutTests/ChangeLog	2012-09-07 22:50:45 UTC (rev 127930)
@@ -1,3 +1,13 @@
+2012-09-07  Gavin Barraclough  <barraclo...@apple.com>
+
+        Object.prototype.__define{G,S}etter__ with non-callable second parameter should throw TypeError instead of SyntaxError
+        https://bugs.webkit.org/show_bug.cgi?id=93873
+
+        Reviewed by Sam Weinig.
+
+        * fast/js/property-getters-and-setters-expected.txt:
+            - updated results
+
 2012-09-07  Ojan Vafai  <o...@chromium.org>
 
         Fix the remaining linter errors. These are all cases of paths

Modified: trunk/LayoutTests/fast/js/property-getters-and-setters-expected.txt (127929 => 127930)


--- trunk/LayoutTests/fast/js/property-getters-and-setters-expected.txt	2012-09-07 22:39:15 UTC (rev 127929)
+++ trunk/LayoutTests/fast/js/property-getters-and-setters-expected.txt	2012-09-07 22:50:45 UTC (rev 127930)
@@ -17,10 +17,10 @@
 PASS o4.__lookupGetter__('b') is getB
 PASS o4.__lookupSetter__('b') is setB
 __defineGetter__ and __defineSetter__ with various invalid arguments
-PASS o5.__defineSetter__('a', null) threw exception SyntaxError: invalid setter usage.
-PASS o5.__defineSetter__('a', o5) threw exception SyntaxError: invalid setter usage.
-PASS o5.__defineGetter__('a', null) threw exception SyntaxError: invalid getter usage.
-PASS o5.__defineGetter__('a', o5) threw exception SyntaxError: invalid getter usage.
+PASS o5.__defineSetter__('a', null) threw exception TypeError: invalid setter usage.
+PASS o5.__defineSetter__('a', o5) threw exception TypeError: invalid setter usage.
+PASS o5.__defineGetter__('a', null) threw exception TypeError: invalid getter usage.
+PASS o5.__defineGetter__('a', o5) threw exception TypeError: invalid getter usage.
 setters and getters with exceptions
 PASS x = o6.x threw exception Exception in get.
 PASS x is 0

Modified: trunk/Source/_javascript_Core/ChangeLog (127929 => 127930)


--- trunk/Source/_javascript_Core/ChangeLog	2012-09-07 22:39:15 UTC (rev 127929)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-09-07 22:50:45 UTC (rev 127930)
@@ -1,3 +1,16 @@
+2012-09-07  Gavin Barraclough  <barraclo...@apple.com>
+
+        Object.prototype.__define{G,S}etter__ with non-callable second parameter should throw TypeError instead of SyntaxError
+        https://bugs.webkit.org/show_bug.cgi?id=93873
+
+        Reviewed by Sam Weinig.
+
+        * runtime/ObjectPrototype.cpp:
+        (JSC::objectProtoFuncDefineGetter):
+            - throw TypeError instead of SyntaxError
+        (JSC::objectProtoFuncDefineSetter):
+            - throw TypeError instead of SyntaxError
+
 2012-09-06  Mark Hahnenberg  <mhahnenb...@apple.com>
 
         JSC should have a zombie mode

Modified: trunk/Source/_javascript_Core/runtime/ObjectPrototype.cpp (127929 => 127930)


--- trunk/Source/_javascript_Core/runtime/ObjectPrototype.cpp	2012-09-07 22:39:15 UTC (rev 127929)
+++ trunk/Source/_javascript_Core/runtime/ObjectPrototype.cpp	2012-09-07 22:50:45 UTC (rev 127930)
@@ -157,7 +157,7 @@
     JSValue get = exec->argument(1);
     CallData callData;
     if (getCallData(get, callData) == CallTypeNone)
-        return throwVMError(exec, createSyntaxError(exec, ASCIILiteral("invalid getter usage")));
+        return throwVMError(exec, createTypeError(exec, ASCIILiteral("invalid getter usage")));
 
     PropertyDescriptor descriptor;
     descriptor.setGetter(get);
@@ -177,7 +177,7 @@
     JSValue set = exec->argument(1);
     CallData callData;
     if (getCallData(set, callData) == CallTypeNone)
-        return throwVMError(exec, createSyntaxError(exec, ASCIILiteral("invalid setter usage")));
+        return throwVMError(exec, createTypeError(exec, ASCIILiteral("invalid setter usage")));
 
     PropertyDescriptor descriptor;
     descriptor.setSetter(set);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to