Title: [184083] releases/WebKitGTK/webkit-2.8
Revision
184083
Author
[email protected]
Date
2015-05-11 05:10:06 -0700 (Mon, 11 May 2015)

Log Message

Merge r182872 - String.prototype.startsWith/endsWith/includes have wrong length in r182673
https://bugs.webkit.org/show_bug.cgi?id=143659

Patch by Jordan Harband <[email protected]> on 2015-04-15
Reviewed by Benjamin Poulain.

Source/_javascript_Core:

Fix lengths of String.prototype.{includes,startsWith,endsWith} per spec
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.includes
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith

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

LayoutTests:

* js/script-tests/string-includes.js:
* js/string-includes-expected.txt:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog (184082 => 184083)


--- releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog	2015-05-11 12:05:49 UTC (rev 184082)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog	2015-05-11 12:10:06 UTC (rev 184083)
@@ -1,5 +1,15 @@
 2015-04-15  Jordan Harband  <[email protected]>
 
+        String.prototype.startsWith/endsWith/includes have wrong length in r182673
+        https://bugs.webkit.org/show_bug.cgi?id=143659
+
+        Reviewed by Benjamin Poulain.
+
+        * js/script-tests/string-includes.js:
+        * js/string-includes-expected.txt:
+
+2015-04-15  Jordan Harband  <[email protected]>
+
         Math.imul has wrong length in Safari 8.0.4
         https://bugs.webkit.org/show_bug.cgi?id=143658
 

Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/js/script-tests/string-includes.js (184082 => 184083)


--- releases/WebKitGTK/webkit-2.8/LayoutTests/js/script-tests/string-includes.js	2015-05-11 12:05:49 UTC (rev 184082)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/js/script-tests/string-includes.js	2015-05-11 12:10:06 UTC (rev 184083)
@@ -1,6 +1,7 @@
 description("This test checks the ES6 string functions startsWith(), endsWith() and includes().");
 
 // Test includes
+shouldBe("String.prototype.includes.length", "1");
 shouldBe("'foo bar'.includes('bar')", "true");
 shouldBe("'foo bar'.includes('bar', 4)", "true");
 shouldBe("'foo bar'.includes('ar', 5)", "true");
@@ -31,6 +32,7 @@
 shouldBe("'フーバー'.includes('クー')", "false");
 
 // Test startsWith
+shouldBe("String.prototype.startsWith.length", "1");
 shouldBe("'foo bar'.startsWith('foo')", "true");
 shouldBe("'foo bar'.startsWith('foo', 0)", "true");
 shouldBe("'foo bar'.startsWith('foo', -1)", "true");
@@ -60,6 +62,7 @@
 shouldBe("'foo bar'.startsWith('フー', 1)", "false");
 
 // Test endsWith
+shouldBe("String.prototype.endsWith.length", "1");
 shouldBe("'foo bar'.endsWith('bar')", "true");
 shouldBe("'foo bar'.endsWith('ba', 6)", "true");
 shouldBe("'foo bar'.endsWith(' ba', 6)", "true");

Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/js/string-includes-expected.txt (184082 => 184083)


--- releases/WebKitGTK/webkit-2.8/LayoutTests/js/string-includes-expected.txt	2015-05-11 12:05:49 UTC (rev 184082)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/js/string-includes-expected.txt	2015-05-11 12:10:06 UTC (rev 184083)
@@ -3,6 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
+PASS String.prototype.includes.length is 1
 PASS 'foo bar'.includes('bar') is true
 PASS 'foo bar'.includes('bar', 4) is true
 PASS 'foo bar'.includes('ar', 5) is true
@@ -31,6 +32,7 @@
 PASS 'foo 1e100 bar'.includes(1e100) is false
 PASS 'フーバー'.includes('ーバ') is true
 PASS 'フーバー'.includes('クー') is false
+PASS String.prototype.startsWith.length is 1
 PASS 'foo bar'.startsWith('foo') is true
 PASS 'foo bar'.startsWith('foo', 0) is true
 PASS 'foo bar'.startsWith('foo', -1) is true
@@ -58,6 +60,7 @@
 PASS 'フーバー'.startsWith('abc', 1) is false
 PASS 'foo bar'.startsWith('フー') is false
 PASS 'foo bar'.startsWith('フー', 1) is false
+PASS String.prototype.endsWith.length is 1
 PASS 'foo bar'.endsWith('bar') is true
 PASS 'foo bar'.endsWith('ba', 6) is true
 PASS 'foo bar'.endsWith(' ba', 6) is true

Modified: releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/ChangeLog (184082 => 184083)


--- releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/ChangeLog	2015-05-11 12:05:49 UTC (rev 184082)
+++ releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/ChangeLog	2015-05-11 12:10:06 UTC (rev 184083)
@@ -1,5 +1,20 @@
 2015-04-15  Jordan Harband  <[email protected]>
 
+        String.prototype.startsWith/endsWith/includes have wrong length in r182673
+        https://bugs.webkit.org/show_bug.cgi?id=143659
+
+        Reviewed by Benjamin Poulain.
+
+        Fix lengths of String.prototype.{includes,startsWith,endsWith} per spec
+        https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.includes
+        https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith
+        https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith
+
+        * runtime/StringPrototype.cpp:
+        (JSC::StringPrototype::finishCreation):
+
+2015-04-15  Jordan Harband  <[email protected]>
+
         Math.imul has wrong length in Safari 8.0.4
         https://bugs.webkit.org/show_bug.cgi?id=143658
 

Modified: releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/runtime/StringPrototype.cpp (184082 => 184083)


--- releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/runtime/StringPrototype.cpp	2015-05-11 12:05:49 UTC (rev 184082)
+++ releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/runtime/StringPrototype.cpp	2015-05-11 12:10:06 UTC (rev 184083)
@@ -2,6 +2,7 @@
  *  Copyright (C) 1999-2001 Harri Porten ([email protected])
  *  Copyright (C) 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserved.
  *  Copyright (C) 2009 Torch Mobile, Inc.
+ *  Copyright (C) 2015 Jordan Harband ([email protected])
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -137,9 +138,9 @@
     JSC_NATIVE_FUNCTION("trim", stringProtoFuncTrim, DontEnum, 0);
     JSC_NATIVE_FUNCTION("trimLeft", stringProtoFuncTrimLeft, DontEnum, 0);
     JSC_NATIVE_FUNCTION("trimRight", stringProtoFuncTrimRight, DontEnum, 0);
-    JSC_NATIVE_FUNCTION("startsWith", stringProtoFuncStartsWith, DontEnum, 0);
-    JSC_NATIVE_FUNCTION("endsWith", stringProtoFuncEndsWith, DontEnum, 0);
-    JSC_NATIVE_FUNCTION("includes", stringProtoFuncIncludes, DontEnum, 0);
+    JSC_NATIVE_FUNCTION("startsWith", stringProtoFuncStartsWith, DontEnum, 1);
+    JSC_NATIVE_FUNCTION("endsWith", stringProtoFuncEndsWith, DontEnum, 1);
+    JSC_NATIVE_FUNCTION("includes", stringProtoFuncIncludes, DontEnum, 1);
 
     // The constructor will be added later, after StringConstructor has been built
     putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), DontDelete | ReadOnly | DontEnum);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to