Title: [202916] trunk
Revision
202916
Author
[email protected]
Date
2016-07-07 10:27:17 -0700 (Thu, 07 Jul 2016)

Log Message

[JSC] String.prototype.normalize should have a length of zero
https://bugs.webkit.org/show_bug.cgi?id=159506

Reviewed by Yusuke Suzuki.

Source/_javascript_Core:

Spec: https://tc39.github.io/ecma262/#sec-string.prototype.normalize
The argument is optional, the length should be zero.

* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):

LayoutTests:

* js/script-tests/string-normalize.js: Added.
(listener.toString):
* js/string-normalize-expected.txt: Added.
* js/string-normalize.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (202915 => 202916)


--- trunk/LayoutTests/ChangeLog	2016-07-07 17:23:25 UTC (rev 202915)
+++ trunk/LayoutTests/ChangeLog	2016-07-07 17:27:17 UTC (rev 202916)
@@ -1,3 +1,15 @@
+2016-07-07  Benjamin Poulain  <[email protected]>
+
+        [JSC] String.prototype.normalize should have a length of zero
+        https://bugs.webkit.org/show_bug.cgi?id=159506
+
+        Reviewed by Yusuke Suzuki.
+
+        * js/script-tests/string-normalize.js: Added.
+        (listener.toString):
+        * js/string-normalize-expected.txt: Added.
+        * js/string-normalize.html: Added.
+
 2016-07-07  Eric Carlson  <[email protected]>
 
         Add a test for media control dropoff

Added: trunk/LayoutTests/js/script-tests/string-normalize.js (0 => 202916)


--- trunk/LayoutTests/js/script-tests/string-normalize.js	                        (rev 0)
+++ trunk/LayoutTests/js/script-tests/string-normalize.js	2016-07-07 17:27:17 UTC (rev 202916)
@@ -0,0 +1,14 @@
+description("Test String.prototype.normalize.");
+
+debug("Basic function properties");
+shouldBeEqualToString("typeof String.prototype.normalize", "function");
+shouldBeEqualToString("String.prototype.normalize.name", "normalize");
+shouldBe("String.prototype.normalize.length", "0");
+shouldBeTrue("Object.getOwnPropertyDescriptor(String.prototype, 'normalize').configurable");
+shouldBeFalse("Object.getOwnPropertyDescriptor(String.prototype, 'normalize').enumerable");
+shouldBeTrue("Object.getOwnPropertyDescriptor(String.prototype, 'normalize').writable");
+
+debug("Invokes ToString on the argument.");
+var listener = { callCount: 0, toString: function() { this.callCount++; return "WebKit"; } }
+shouldBeEqualToString("String.prototype.normalize.call(listener)", "WebKit");
+shouldBe("listener.callCount", "1");

Added: trunk/LayoutTests/js/string-normalize-expected.txt (0 => 202916)


--- trunk/LayoutTests/js/string-normalize-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/string-normalize-expected.txt	2016-07-07 17:27:17 UTC (rev 202916)
@@ -0,0 +1,19 @@
+Test String.prototype.normalize.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Basic function properties
+PASS typeof String.prototype.normalize is "function"
+PASS String.prototype.normalize.name is "normalize"
+PASS String.prototype.normalize.length is 0
+PASS Object.getOwnPropertyDescriptor(String.prototype, 'normalize').configurable is true
+PASS Object.getOwnPropertyDescriptor(String.prototype, 'normalize').enumerable is false
+PASS Object.getOwnPropertyDescriptor(String.prototype, 'normalize').writable is true
+Invokes ToString on the argument.
+PASS String.prototype.normalize.call(listener) is "WebKit"
+PASS listener.callCount is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/string-normalize.html (0 => 202916)


--- trunk/LayoutTests/js/string-normalize.html	                        (rev 0)
+++ trunk/LayoutTests/js/string-normalize.html	2016-07-07 17:27:17 UTC (rev 202916)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="UTF-8">
+  <script src=""
+</head>
+<body>
+  <script src=""
+  <script src=""
+</body>
+</html>

Modified: trunk/Source/_javascript_Core/ChangeLog (202915 => 202916)


--- trunk/Source/_javascript_Core/ChangeLog	2016-07-07 17:23:25 UTC (rev 202915)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-07-07 17:27:17 UTC (rev 202916)
@@ -1,3 +1,16 @@
+2016-07-07  Benjamin Poulain  <[email protected]>
+
+        [JSC] String.prototype.normalize should have a length of zero
+        https://bugs.webkit.org/show_bug.cgi?id=159506
+
+        Reviewed by Yusuke Suzuki.
+
+        Spec: https://tc39.github.io/ecma262/#sec-string.prototype.normalize
+        The argument is optional, the length should be zero.
+
+        * runtime/StringPrototype.cpp:
+        (JSC::StringPrototype::finishCreation):
+
 2016-07-07  Csaba Osztrogonác  <[email protected]>
 
         [ARMv7] REGRESSION(r197655): ASSERTION FAILED: (cond == Zero) || (cond == NonZero)

Modified: trunk/Source/_javascript_Core/runtime/StringPrototype.cpp (202915 => 202916)


--- trunk/Source/_javascript_Core/runtime/StringPrototype.cpp	2016-07-07 17:23:25 UTC (rev 202915)
+++ trunk/Source/_javascript_Core/runtime/StringPrototype.cpp	2016-07-07 17:27:17 UTC (rev 202916)
@@ -173,7 +173,7 @@
     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("startsWith", stringProtoFuncStartsWith, DontEnum, 1);
     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("endsWith", stringProtoFuncEndsWith, DontEnum, 1);
     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("includes", stringProtoFuncIncludes, DontEnum, 1);
-    JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("normalize", stringProtoFuncNormalize, DontEnum, 1);
+    JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("normalize", stringProtoFuncNormalize, DontEnum, 0);
     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->iteratorSymbol, stringProtoFuncIterator, DontEnum, 0);
 
     JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->builtinNames().charCodeAtPrivateName(), stringProtoFuncCharCodeAt, DontEnum, 1, CharCodeAtIntrinsic);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to