Changeset 182872 in webkit
- Timestamp:
- Apr 15, 2015, 5:15:11 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/js/script-tests/string-includes.js (modified) (3 diffs)
-
LayoutTests/js/string-includes-expected.txt (modified) (3 diffs)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/runtime/StringPrototype.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r182868 r182872 1 2015-04-15 Jordan Harband <ljharb@gmail.com> 2 3 String.prototype.startsWith/endsWith/includes have wrong length in r182673 4 https://bugs.webkit.org/show_bug.cgi?id=143659 5 6 Reviewed by Benjamin Poulain. 7 8 * js/script-tests/string-includes.js: 9 * js/string-includes-expected.txt: 10 1 11 2015-04-15 Jordan Harband <ljharb@gmail.com> 2 12 -
trunk/LayoutTests/js/script-tests/string-includes.js
r181105 r182872 2 2 3 3 // Test includes 4 shouldBe("String.prototype.includes.length", "1"); 4 5 shouldBe("'foo bar'.includes('bar')", "true"); 5 6 shouldBe("'foo bar'.includes('bar', 4)", "true"); … … 32 33 33 34 // Test startsWith 35 shouldBe("String.prototype.startsWith.length", "1"); 34 36 shouldBe("'foo bar'.startsWith('foo')", "true"); 35 37 shouldBe("'foo bar'.startsWith('foo', 0)", "true"); … … 61 63 62 64 // Test endsWith 65 shouldBe("String.prototype.endsWith.length", "1"); 63 66 shouldBe("'foo bar'.endsWith('bar')", "true"); 64 67 shouldBe("'foo bar'.endsWith('ba', 6)", "true"); -
trunk/LayoutTests/js/string-includes-expected.txt
r181105 r182872 4 4 5 5 6 PASS String.prototype.includes.length is 1 6 7 PASS 'foo bar'.includes('bar') is true 7 8 PASS 'foo bar'.includes('bar', 4) is true … … 32 33 PASS 'フーバー'.includes('ーバ') is true 33 34 PASS 'フーバー'.includes('クー') is false 35 PASS String.prototype.startsWith.length is 1 34 36 PASS 'foo bar'.startsWith('foo') is true 35 37 PASS 'foo bar'.startsWith('foo', 0) is true … … 59 61 PASS 'foo bar'.startsWith('フー') is false 60 62 PASS 'foo bar'.startsWith('フー', 1) is false 63 PASS String.prototype.endsWith.length is 1 61 64 PASS 'foo bar'.endsWith('bar') is true 62 65 PASS 'foo bar'.endsWith('ba', 6) is true -
trunk/Source/JavaScriptCore/ChangeLog
r182871 r182872 1 2015-04-15 Jordan Harband <ljharb@gmail.com> 2 3 String.prototype.startsWith/endsWith/includes have wrong length in r182673 4 https://bugs.webkit.org/show_bug.cgi?id=143659 5 6 Reviewed by Benjamin Poulain. 7 8 Fix lengths of String.prototype.{includes,startsWith,endsWith} per spec 9 https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.includes 10 https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith 11 https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith 12 13 * runtime/StringPrototype.cpp: 14 (JSC::StringPrototype::finishCreation): 15 1 16 2015-04-15 Mark Lam <mark.lam@apple.com> 2 17 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r182205 r182872 3 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2009 Torch Mobile, Inc. 5 * Copyright (C) 2015 Jordan Harband (ljharb@gmail.com) 5 6 * 6 7 * This library is free software; you can redistribute it and/or … … 140 141 JSC_NATIVE_FUNCTION("trimLeft", stringProtoFuncTrimLeft, DontEnum, 0); 141 142 JSC_NATIVE_FUNCTION("trimRight", stringProtoFuncTrimRight, DontEnum, 0); 142 JSC_NATIVE_FUNCTION("startsWith", stringProtoFuncStartsWith, DontEnum, 0);143 JSC_NATIVE_FUNCTION("endsWith", stringProtoFuncEndsWith, DontEnum, 0);144 JSC_NATIVE_FUNCTION("includes", stringProtoFuncIncludes, DontEnum, 0);143 JSC_NATIVE_FUNCTION("startsWith", stringProtoFuncStartsWith, DontEnum, 1); 144 JSC_NATIVE_FUNCTION("endsWith", stringProtoFuncEndsWith, DontEnum, 1); 145 JSC_NATIVE_FUNCTION("includes", stringProtoFuncIncludes, DontEnum, 1); 145 146 JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorSymbol, stringProtoFuncIterator, DontEnum, 0); 146 147
Note:
See TracChangeset
for help on using the changeset viewer.