Title: [198000] trunk/Source/_javascript_Core
Revision
198000
Author
[email protected]
Date
2016-03-10 23:13:10 -0800 (Thu, 10 Mar 2016)

Log Message

[ES6] Make RegExp.prototype.toString spec compliant
https://bugs.webkit.org/show_bug.cgi?id=155341

Patch by Saam barati <[email protected]> on 2016-03-10
Reviewed by Filip Pizlo.

Before we were directly calling into the flagsString
function. Instead, we must get the "flags" property
of the thisObject. This will usually call into the flags
getter, but not always. Specifically, you can you a Proxy
to observe this behavior.

* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncToString):
(JSC::regExpProtoGetterGlobal):
* tests/es6.yaml:
* tests/es6/Proxy_internal_get_calls_RegExp.prototype.toString.js: Added.
(test.get var):
(test.):
* tests/stress/regexp-prototype-tostring.js: Added.
(assert):
(test):
(test.get var):
(test.):
(let.handler.get switch):
(let.handler):
(get test):
(test.get RegExp):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/tests/TypedArrayCTest.cpp (197999 => 198000)


--- trunk/Source/_javascript_Core/API/tests/TypedArrayCTest.cpp	2016-03-11 07:10:18 UTC (rev 197999)
+++ trunk/Source/_javascript_Core/API/tests/TypedArrayCTest.cpp	2016-03-11 07:13:10 UTC (rev 198000)
@@ -46,7 +46,7 @@
     10,
 };
 
-static const unsigned byteSizes[kJSTypedArrayTypeNone] =
+static const unsigned byteSizes[kJSTypedArrayTypeArrayBuffer] =
 {
     1, // kJSTypedArrayTypeInt8Array
     2, // kJSTypedArrayTypeInt16Array
@@ -59,9 +59,8 @@
     8, // kJSTypedArrayTypeFloat64Array
 };
 
-static const char* typeToString[kJSTypedArrayTypeNone] =
+static const char* typeToString[kJSTypedArrayTypeArrayBuffer] =
 {
-
     "kJSTypedArrayTypeInt8Array",
     "kJSTypedArrayTypeInt16Array",
     "kJSTypedArrayTypeInt32Array",
@@ -91,7 +90,7 @@
 
 static int testAccess(JSGlobalContextRef context, JSObjectRef typedArray, JSTypedArrayType type, unsigned elementLength, void* expectedPtr = nullptr, JSObjectRef expectedBuffer = nullptr, unsigned expectedOffset = 0)
 {
-    JSValueRef exception;
+    JSValueRef exception = nullptr;
     // Test typedArray basic functions.
     JSTypedArrayType actualType = JSValueGetTypedArrayType(context, typedArray, &exception);
     if (type != actualType || exception) {
@@ -151,7 +150,7 @@
 static int testConstructors(JSGlobalContextRef context, JSTypedArrayType type, unsigned length)
 {
     int failed = 0;
-    JSValueRef exception;
+    JSValueRef exception = nullptr;
     JSObjectRef typedArray;
 
     // Test create with length.
@@ -210,7 +209,7 @@
 static int forEachTypedArrayType(const Functor& functor)
 {
     int failed = 0;
-    for (unsigned i = 0; i < kJSTypedArrayTypeNone; i++)
+    for (unsigned i = 0; i < kJSTypedArrayTypeArrayBuffer; i++)
         failed = failed || functor(static_cast<JSTypedArrayType>(i));
     return failed;
 }
@@ -262,6 +261,8 @@
 
     if (!failed)
         printf("PASS: Typed Array C API Tests.\n");
+    else
+        printf("FAIL: Some Typed Array C API Tests failed.\n");
 
     return failed;
 }

Modified: trunk/Source/_javascript_Core/ChangeLog (197999 => 198000)


--- trunk/Source/_javascript_Core/ChangeLog	2016-03-11 07:10:18 UTC (rev 197999)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-03-11 07:13:10 UTC (rev 198000)
@@ -57,6 +57,16 @@
 
 2016-03-10  Keith Miller  <[email protected]>
 
+        Unreviewed, fix testapi.
+
+        * API/tests/TypedArrayCTest.cpp:
+        (testAccess):
+        (testConstructors):
+        (forEachTypedArrayType):
+        (testTypedArrayCAPI):
+
+2016-03-10  Keith Miller  <[email protected]>
+
         Unreviewed, build fix for r197983, hopefully.
 
         * API/WebKitAvailability.h:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to