Changeset 215852 in webkit
- Timestamp:
- Apr 26, 2017 7:28:39 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r215843 r215852 1 2017-04-26 Saam Barati <sbarati@apple.com> 2 3 ASSERTION FAILED: inIndex != notFound in JSC::invalidParameterInSourceAppender() 4 https://bugs.webkit.org/show_bug.cgi?id=170924 5 <rdar://problem/31721052> 6 7 Reviewed by Mark Lam. 8 9 * stress/error-message-for-function-base-not-found.js: Added. 10 (assert): 11 (throw.new.Error): 12 * stress/error-messages-for-in-operator-should-not-crash.js: Added. 13 (catch): 14 1 15 2017-04-26 Keith Miller <keith_miller@apple.com> 2 16 -
trunk/JSTests/stress/destructuring-assignment-accepts-iterables.js
r185791 r215852 123 123 } 124 124 }; 125 }, "TypeError: [a, b, c] is not a function. (In '[a, b, c]', '[a, b, c]' is undefined)");125 }, "TypeError: undefined is not a function (near '...[a, b, c]...')"); 126 126 127 127 shouldThrow(function () { … … 131 131 } 132 132 }; 133 }, "TypeError: [a, b, c] is not a function. (In '[a, b, c]', '[a, b, c]' is undefined)");133 }, "TypeError: undefined is not a function (near '...[a, b, c]...')"); 134 134 135 135 shouldThrow(function () { -
trunk/LayoutTests/ChangeLog
r215850 r215852 1 2017-04-26 Saam Barati <sbarati@apple.com> 2 3 ASSERTION FAILED: inIndex != notFound in JSC::invalidParameterInSourceAppender() 4 https://bugs.webkit.org/show_bug.cgi?id=170924 5 <rdar://problem/31721052> 6 7 Reviewed by Mark Lam. 8 9 * js/let-syntax-expected.txt: 10 1 11 2017-04-26 Joanmarie Diggs <jdiggs@igalia.com> 2 12 -
trunk/LayoutTests/imported/w3c/ChangeLog
r215842 r215852 1 2017-04-26 Saam Barati <sbarati@apple.com> 2 3 ASSERTION FAILED: inIndex != notFound in JSC::invalidParameterInSourceAppender() 4 https://bugs.webkit.org/show_bug.cgi?id=170924 5 <rdar://problem/31721052> 6 7 Reviewed by Mark Lam. 8 9 * web-platform-tests/css-timing-1/cubic-bezier-timing-functions-output-expected.txt: 10 * web-platform-tests/css-timing-1/frames-timing-functions-output-expected.txt: 11 * web-platform-tests/css-timing-1/step-timing-functions-output-expected.txt: 12 1 13 2017-04-26 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css-timing-1/cubic-bezier-timing-functions-output-expected.txt
r215164 r215852 1 1 2 FAIL cubic-bezier easing with input progress greater than 1 target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)3 FAIL cubic-bezier easing with input progress greater than 1 and where the tangent on the upper boundary is infinity target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)4 FAIL cubic-bezier easing with input progress less than 0 target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)5 FAIL cubic-bezier easing with input progress less than 0 and where the tangent on the lower boundary is infinity target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)2 FAIL cubic-bezier easing with input progress greater than 1 undefined is not a function (near '...target.animate...') 3 FAIL cubic-bezier easing with input progress greater than 1 and where the tangent on the upper boundary is infinity undefined is not a function (near '...target.animate...') 4 FAIL cubic-bezier easing with input progress less than 0 undefined is not a function (near '...target.animate...') 5 FAIL cubic-bezier easing with input progress less than 0 and where the tangent on the lower boundary is infinity undefined is not a function (near '...target.animate...') 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css-timing-1/frames-timing-functions-output-expected.txt
r215164 r215852 5 5 FAIL The number of frames is correctly reflected in the frames timing function output assert_equals: expected "0px" but got "auto" 6 6 FAIL The number of frames is correctly reflected in the frames timing function output on CSS Transitions assert_equals: expected "0px" but got "auto" 7 FAIL frames easing with input progress greater than 1 target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)8 FAIL frames easing with input progress greater than 1.5 target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)9 FAIL frames easing with input progress less than 0 target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)7 FAIL frames easing with input progress greater than 1 undefined is not a function (near '...target.animate...') 8 FAIL frames easing with input progress greater than 1.5 undefined is not a function (near '...target.animate...') 9 FAIL frames easing with input progress less than 0 undefined is not a function (near '...target.animate...') 10 10 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css-timing-1/step-timing-functions-output-expected.txt
r215164 r215852 1 1 2 FAIL step-start easing with input progress greater than 1 target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)3 FAIL step-end easing with input progress greater than 1 target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)4 FAIL step-end easing with input progress greater than 2 target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)5 FAIL step-start easing with input progress less than 0 target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)6 FAIL step-start easing with input progress less than -1 target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)7 FAIL step-end easing with input progress less than 0 target.animate is not a function. (In 'target.animate', 'target.animate' is undefined)2 FAIL step-start easing with input progress greater than 1 undefined is not a function (near '...target.animate...') 3 FAIL step-end easing with input progress greater than 1 undefined is not a function (near '...target.animate...') 4 FAIL step-end easing with input progress greater than 2 undefined is not a function (near '...target.animate...') 5 FAIL step-start easing with input progress less than 0 undefined is not a function (near '...target.animate...') 6 FAIL step-start easing with input progress less than -1 undefined is not a function (near '...target.animate...') 7 FAIL step-end easing with input progress less than 0 undefined is not a function (near '...target.animate...') 8 8 -
trunk/LayoutTests/js/let-syntax-expected.txt
r215682 r215852 405 405 SyntaxError: Cannot use abbreviated destructuring syntax for keyword 'let'. 406 406 PASS Has syntax error: ''use strict'; var {let} = 40;' 407 TypeError: [let] is not a function. (In '[let]', '[let]' is undefined)407 TypeError: undefined is not a function (near '...[let]...') 408 408 PASS Does not have syntax error: 'var [let] = 40;' 409 409 SyntaxError: Cannot use 'let' as a variable name in strict mode. -
trunk/Source/JavaScriptCore/ChangeLog
r215843 r215852 1 2017-04-26 Saam Barati <sbarati@apple.com> 2 3 ASSERTION FAILED: inIndex != notFound in JSC::invalidParameterInSourceAppender() 4 https://bugs.webkit.org/show_bug.cgi?id=170924 5 <rdar://problem/31721052> 6 7 Reviewed by Mark Lam. 8 9 The error message handler for "in" was searching for the literal 10 string "in". However, our parser incorrectly allows escaped characters 11 to be part of keywords. So this is parsed as "in" in JSC: "i\u006E". 12 It should not be parsed that way. I opened https://bugs.webkit.org/show_bug.cgi?id=171310 13 to address this issue. 14 15 Regardless, the error message handlers should handle unexpected text gracefully. 16 All functions that try to augment error messages with the goal of 17 providing a more textual context for the error message should use 18 the original error message instead of crashing when they detect 19 unexpected text. 20 21 This patch also changes the already buggy code that tries to find 22 the base of a function call. That could would fail for code like this: 23 "zoo.bar("/abc\)*/");". See https://bugs.webkit.org/show_bug.cgi?id=146304 24 It would think that the base is "z". However, the algorithm that tries 25 to find the base can often tell when it fails, and when it does, it should 26 happily return the approximate text error message instead of thinking 27 that the base is "z". 28 29 * runtime/ExceptionHelpers.cpp: 30 (JSC::functionCallBase): 31 (JSC::notAFunctionSourceAppender): 32 (JSC::invalidParameterInSourceAppender): 33 1 34 2017-04-26 Keith Miller <keith_miller@apple.com> 2 35 -
trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
r215402 r215852 128 128 // will not inlcude the text in between these parentheses, it will just be the desired 129 129 // text that precedes the parentheses. 130 return sourceText;130 return String(); 131 131 } 132 132 … … 136 136 // Note that we're scanning text right to left instead of the more common left to right, 137 137 // so syntax detection is backwards. 138 while (parenStack > 0) {138 while (parenStack && idx) { 139 139 UChar curChar = sourceText[idx]; 140 if (isInMultiLineComment) 141 if ( idx > 0 &&curChar == '*' && sourceText[idx - 1] == '/') {140 if (isInMultiLineComment) { 141 if (curChar == '*' && sourceText[idx - 1] == '/') { 142 142 isInMultiLineComment = false; 143 idx -= 1;143 --idx; 144 144 } 145 145 } else if (curChar == '(') 146 parenStack -= 1;146 --parenStack; 147 147 else if (curChar == ')') 148 parenStack += 1;149 else if ( idx > 0 &&curChar == '/' && sourceText[idx - 1] == '*') {148 ++parenStack; 149 else if (curChar == '/' && sourceText[idx - 1] == '*') { 150 150 isInMultiLineComment = true; 151 idx -= 1;151 --idx; 152 152 } 153 153 154 if (!idx) 155 break; 156 157 idx -= 1; 154 if (idx) 155 --idx; 156 } 157 158 if (parenStack) { 159 // As noted in the FIXME at the top of this function, there are bugs 160 // in the above string processing. This algorithm is mostly best effort 161 // and it works for most JS text in practice. However, if we determine 162 // that the algorithm failed, we should just return the empty value. 163 return String(); 158 164 } 159 165 … … 178 184 179 185 String base = functionCallBase(sourceText); 186 if (!base) 187 return defaultApproximateSourceError(originalMessage, sourceText); 180 188 StringBuilder builder; 181 189 builder.append(base); … … 206 214 ASSERT(occurrence == ErrorInstance::FoundExactSource); 207 215 auto inIndex = sourceText.reverseFind("in"); 208 RELEASE_ASSERT(inIndex != notFound); 216 if (inIndex == notFound) { 217 // This should basically never happen, since JS code must use the literal 218 // text "in" for the `in` operation. However, if we fail to find "in" 219 // for any reason, just fail gracefully. 220 return originalMessage; 221 } 209 222 if (sourceText.find("in") != inIndex) 210 223 return makeString(originalMessage, " (evaluating '", sourceText, "')");
Note: See TracChangeset
for help on using the changeset viewer.