Changeset 207798 in webkit
- Timestamp:
- Oct 24, 2016 7:35:59 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChakraCore/test/Operators/instanceof.baseline-jsc
r205387 r207798 229 229 Exception: new Object() instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'new Object() instanceof new Boolean(false)') 230 230 Exception: new Object() instanceof new Date(). new Date() is not a function. (evaluating 'new Object() instanceof new Date()') 231 Exception: new Object() instanceof /a+/. / is not a function. (evaluating 'new Object() instanceof/')231 Exception: new Object() instanceof /a+/. /a+/ is not a function. (evaluating 'new Object() instanceof /a+/') 232 232 Exception: f instanceof new Object(). new Object() is not a function. (evaluating 'f instanceof new Object()') 233 233 Exception: f instanceof f. f is not a function. (evaluating 'f instanceof f') … … 250 250 Exception: f instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'f instanceof new Boolean(false)') 251 251 Exception: f instanceof new Date(). new Date() is not a function. (evaluating 'f instanceof new Date()') 252 Exception: f instanceof /a+/. / is not a function. (evaluating 'f instanceof/')252 Exception: f instanceof /a+/. /a+/ is not a function. (evaluating 'f instanceof /a+/') 253 253 Exception: b instanceof new Object(). new Object() is not a function. (evaluating 'b instanceof new Object()') 254 254 Exception: b instanceof f. f is not a function. (evaluating 'b instanceof f') … … 271 271 Exception: b instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'b instanceof new Boolean(false)') 272 272 Exception: b instanceof new Date(). new Date() is not a function. (evaluating 'b instanceof new Date()') 273 Exception: b instanceof /a+/. / is not a function. (evaluating 'b instanceof/')273 Exception: b instanceof /a+/. /a+/ is not a function. (evaluating 'b instanceof /a+/') 274 274 Exception: foo instanceof new Object(). new Object() is not a function. (evaluating 'foo instanceof new Object()') 275 275 Exception: foo instanceof f. f is not a function. (evaluating 'foo instanceof f') … … 292 292 Exception: foo instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'foo instanceof new Boolean(false)') 293 293 Exception: foo instanceof new Date(). new Date() is not a function. (evaluating 'foo instanceof new Date()') 294 Exception: foo instanceof /a+/. / is not a function. (evaluating 'foo instanceof/')294 Exception: foo instanceof /a+/. /a+/ is not a function. (evaluating 'foo instanceof /a+/') 295 295 Exception: String.fromCharCode instanceof new Object(). new Object() is not a function. (evaluating 'String.fromCharCode instanceof new Object()') 296 296 Exception: String.fromCharCode instanceof f. f is not a function. (evaluating 'String.fromCharCode instanceof f') … … 313 313 Exception: String.fromCharCode instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'String.fromCharCode instanceof new Boolean(false)') 314 314 Exception: String.fromCharCode instanceof new Date(). new Date() is not a function. (evaluating 'String.fromCharCode instanceof new Date()') 315 Exception: String.fromCharCode instanceof /a+/. / is not a function. (evaluating 'String.fromCharCode instanceof/')315 Exception: String.fromCharCode instanceof /a+/. /a+/ is not a function. (evaluating 'String.fromCharCode instanceof /a+/') 316 316 Exception: Array.prototype.concat instanceof new Object(). new Object() is not a function. (evaluating 'Array.prototype.concat instanceof new Object()') 317 317 Exception: Array.prototype.concat instanceof f. f is not a function. (evaluating 'Array.prototype.concat instanceof f') … … 334 334 Exception: Array.prototype.concat instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'Array.prototype.concat instanceof new Boolean(false)') 335 335 Exception: Array.prototype.concat instanceof new Date(). new Date() is not a function. (evaluating 'Array.prototype.concat instanceof new Date()') 336 Exception: Array.prototype.concat instanceof /a+/. / is not a function. (evaluating 'Array.prototype.concat instanceof/')336 Exception: Array.prototype.concat instanceof /a+/. /a+/ is not a function. (evaluating 'Array.prototype.concat instanceof /a+/') 337 337 Exception: [1,2,3] instanceof new Object(). new Object() is not a function. (evaluating '[1,2,3] instanceof new Object()') 338 338 Exception: [1,2,3] instanceof f. f is not a function. (evaluating '[1,2,3] instanceof f') … … 355 355 Exception: [1,2,3] instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating '[1,2,3] instanceof new Boolean(false)') 356 356 Exception: [1,2,3] instanceof new Date(). new Date() is not a function. (evaluating '[1,2,3] instanceof new Date()') 357 Exception: [1,2,3] instanceof /a+/. / is not a function. (evaluating '[1,2,3] instanceof/')357 Exception: [1,2,3] instanceof /a+/. /a+/ is not a function. (evaluating '[1,2,3] instanceof /a+/') 358 358 Exception: new Array() instanceof new Object(). new Object() is not a function. (evaluating 'new Array() instanceof new Object()') 359 359 Exception: new Array() instanceof f. f is not a function. (evaluating 'new Array() instanceof f') … … 376 376 Exception: new Array() instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'new Array() instanceof new Boolean(false)') 377 377 Exception: new Array() instanceof new Date(). new Date() is not a function. (evaluating 'new Array() instanceof new Date()') 378 Exception: new Array() instanceof /a+/. / is not a function. (evaluating 'new Array() instanceof/')378 Exception: new Array() instanceof /a+/. /a+/ is not a function. (evaluating 'new Array() instanceof /a+/') 379 379 Exception: fncs instanceof new Object(). new Object() is not a function. (evaluating 'fncs instanceof new Object()') 380 380 Exception: fncs instanceof f. f is not a function. (evaluating 'fncs instanceof f') … … 397 397 Exception: fncs instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'fncs instanceof new Boolean(false)') 398 398 Exception: fncs instanceof new Date(). new Date() is not a function. (evaluating 'fncs instanceof new Date()') 399 Exception: fncs instanceof /a+/. / is not a function. (evaluating 'fncs instanceof/')399 Exception: fncs instanceof /a+/. /a+/ is not a function. (evaluating 'fncs instanceof /a+/') 400 400 Exception: 'hello' instanceof new Object(). new Object() is not a function. (evaluating ''hello' instanceof new Object()') 401 401 Exception: 'hello' instanceof f. f is not a function. (evaluating ''hello' instanceof f') … … 418 418 Exception: 'hello' instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating ''hello' instanceof new Boolean(false)') 419 419 Exception: 'hello' instanceof new Date(). new Date() is not a function. (evaluating ''hello' instanceof new Date()') 420 Exception: 'hello' instanceof /a+/. / is not a function. (evaluating ''hello' instanceof/')420 Exception: 'hello' instanceof /a+/. /a+/ is not a function. (evaluating ''hello' instanceof /a+/') 421 421 Exception: new String('world') instanceof new Object(). new Object() is not a function. (evaluating 'new String('world') instanceof new Object()') 422 422 Exception: new String('world') instanceof f. f is not a function. (evaluating 'new String('world') instanceof f') … … 439 439 Exception: new String('world') instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'new String('world') instanceof new Boolean(false)') 440 440 Exception: new String('world') instanceof new Date(). new Date() is not a function. (evaluating 'new String('world') instanceof new Date()') 441 Exception: new String('world') instanceof /a+/. / is not a function. (evaluating 'new String('world') instanceof/')441 Exception: new String('world') instanceof /a+/. /a+/ is not a function. (evaluating 'new String('world') instanceof /a+/') 442 442 Exception: 10 instanceof new Object(). new Object() is not a function. (evaluating '10 instanceof new Object()') 443 443 Exception: 10 instanceof f. f is not a function. (evaluating '10 instanceof f') … … 460 460 Exception: 10 instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating '10 instanceof new Boolean(false)') 461 461 Exception: 10 instanceof new Date(). new Date() is not a function. (evaluating '10 instanceof new Date()') 462 Exception: 10 instanceof /a+/. / is not a function. (evaluating '10 instanceof/')462 Exception: 10 instanceof /a+/. /a+/ is not a function. (evaluating '10 instanceof /a+/') 463 463 Exception: 10.2 instanceof new Object(). new Object() is not a function. (evaluating '10.2 instanceof new Object()') 464 464 Exception: 10.2 instanceof f. f is not a function. (evaluating '10.2 instanceof f') … … 481 481 Exception: 10.2 instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating '10.2 instanceof new Boolean(false)') 482 482 Exception: 10.2 instanceof new Date(). new Date() is not a function. (evaluating '10.2 instanceof new Date()') 483 Exception: 10.2 instanceof /a+/. / is not a function. (evaluating '10.2 instanceof/')483 Exception: 10.2 instanceof /a+/. /a+/ is not a function. (evaluating '10.2 instanceof /a+/') 484 484 Exception: NaN instanceof new Object(). new Object() is not a function. (evaluating 'NaN instanceof new Object()') 485 485 Exception: NaN instanceof f. f is not a function. (evaluating 'NaN instanceof f') … … 502 502 Exception: NaN instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'NaN instanceof new Boolean(false)') 503 503 Exception: NaN instanceof new Date(). new Date() is not a function. (evaluating 'NaN instanceof new Date()') 504 Exception: NaN instanceof /a+/. / is not a function. (evaluating 'NaN instanceof/')504 Exception: NaN instanceof /a+/. /a+/ is not a function. (evaluating 'NaN instanceof /a+/') 505 505 Exception: new Number(3) instanceof new Object(). new Object() is not a function. (evaluating 'new Number(3) instanceof new Object()') 506 506 Exception: new Number(3) instanceof f. f is not a function. (evaluating 'new Number(3) instanceof f') … … 523 523 Exception: new Number(3) instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'new Number(3) instanceof new Boolean(false)') 524 524 Exception: new Number(3) instanceof new Date(). new Date() is not a function. (evaluating 'new Number(3) instanceof new Date()') 525 Exception: new Number(3) instanceof /a+/. / is not a function. (evaluating 'new Number(3) instanceof/')525 Exception: new Number(3) instanceof /a+/. /a+/ is not a function. (evaluating 'new Number(3) instanceof /a+/') 526 526 Exception: true instanceof new Object(). new Object() is not a function. (evaluating 'true instanceof new Object()') 527 527 Exception: true instanceof f. f is not a function. (evaluating 'true instanceof f') … … 544 544 Exception: true instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'true instanceof new Boolean(false)') 545 545 Exception: true instanceof new Date(). new Date() is not a function. (evaluating 'true instanceof new Date()') 546 Exception: true instanceof /a+/. / is not a function. (evaluating 'true instanceof/')546 Exception: true instanceof /a+/. /a+/ is not a function. (evaluating 'true instanceof /a+/') 547 547 Exception: false instanceof new Object(). new Object() is not a function. (evaluating 'false instanceof new Object()') 548 548 Exception: false instanceof f. f is not a function. (evaluating 'false instanceof f') … … 565 565 Exception: false instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'false instanceof new Boolean(false)') 566 566 Exception: false instanceof new Date(). new Date() is not a function. (evaluating 'false instanceof new Date()') 567 Exception: false instanceof /a+/. / is not a function. (evaluating 'false instanceof/')567 Exception: false instanceof /a+/. /a+/ is not a function. (evaluating 'false instanceof /a+/') 568 568 Exception: new Boolean(true) instanceof new Object(). new Object() is not a function. (evaluating 'new Boolean(true) instanceof new Object()') 569 569 Exception: new Boolean(true) instanceof f. f is not a function. (evaluating 'new Boolean(true) instanceof f') … … 586 586 Exception: new Boolean(true) instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'new Boolean(true) instanceof new Boolean(false)') 587 587 Exception: new Boolean(true) instanceof new Date(). new Date() is not a function. (evaluating 'new Boolean(true) instanceof new Date()') 588 Exception: new Boolean(true) instanceof /a+/. / is not a function. (evaluating 'new Boolean(true) instanceof/')588 Exception: new Boolean(true) instanceof /a+/. /a+/ is not a function. (evaluating 'new Boolean(true) instanceof /a+/') 589 589 Exception: new Boolean(false) instanceof new Object(). new Object() is not a function. (evaluating 'new Boolean(false) instanceof new Object()') 590 590 Exception: new Boolean(false) instanceof f. f is not a function. (evaluating 'new Boolean(false) instanceof f') … … 607 607 Exception: new Boolean(false) instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'new Boolean(false) instanceof new Boolean(false)') 608 608 Exception: new Boolean(false) instanceof new Date(). new Date() is not a function. (evaluating 'new Boolean(false) instanceof new Date()') 609 Exception: new Boolean(false) instanceof /a+/. / is not a function. (evaluating 'new Boolean(false) instanceof/')609 Exception: new Boolean(false) instanceof /a+/. /a+/ is not a function. (evaluating 'new Boolean(false) instanceof /a+/') 610 610 Exception: new Date() instanceof new Object(). new Object() is not a function. (evaluating 'new Date() instanceof new Object()') 611 611 Exception: new Date() instanceof f. f is not a function. (evaluating 'new Date() instanceof f') … … 628 628 Exception: new Date() instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating 'new Date() instanceof new Boolean(false)') 629 629 Exception: new Date() instanceof new Date(). new Date() is not a function. (evaluating 'new Date() instanceof new Date()') 630 Exception: new Date() instanceof /a+/. / is not a function. (evaluating 'new Date() instanceof/')630 Exception: new Date() instanceof /a+/. /a+/ is not a function. (evaluating 'new Date() instanceof /a+/') 631 631 Exception: /a+/ instanceof new Object(). new Object() is not a function. (evaluating '/a+/ instanceof new Object()') 632 632 Exception: /a+/ instanceof f. f is not a function. (evaluating '/a+/ instanceof f') … … 649 649 Exception: /a+/ instanceof new Boolean(false). new Boolean(false) is not a function. (evaluating '/a+/ instanceof new Boolean(false)') 650 650 Exception: /a+/ instanceof new Date(). new Date() is not a function. (evaluating '/a+/ instanceof new Date()') 651 Exception: /a+/ instanceof /a+/. / is not a function. (evaluating '/a+/ instanceof/')651 Exception: /a+/ instanceof /a+/. /a+/ is not a function. (evaluating '/a+/ instanceof /a+/') -
trunk/JSTests/ChakraCore/test/Regex/nul_character.baseline-jsc
r205387 r207798 1 1 --- 1 --- 2 2 5 3 SyntaxError: Un expected token '/'. Invalid regular expression.4 SyntaxError: Un expected token '/'. Invalid regular expression.3 SyntaxError: Unterminated regular expression literal '/' 4 SyntaxError: Unterminated regular expression literal '/' 5 5 --- 2 --- 6 6 4 7 SyntaxError: Un expected token '/'. Invalid regular expression.8 SyntaxError: Un expected token '/'. Invalid regular expression.9 SyntaxError: Un expected token '/'. Invalid regular expression.10 SyntaxError: Un expected token '/'. Invalid regular expression.11 SyntaxError: Un expected token '/'. Invalid regular expression.7 SyntaxError: Unterminated regular expression literal '/\' 8 SyntaxError: Unterminated regular expression literal '/\' 9 SyntaxError: Unterminated regular expression literal '/\' 10 SyntaxError: Unterminated regular expression literal '/\' 11 SyntaxError: Unterminated regular expression literal '/\' 12 12 4 13 13 5 14 14 --- 3 --- 15 SyntaxError: Un expected token '/'. Invalid regular expression.16 SyntaxError: Un expected token '/'. Invalid regular expression.17 SyntaxError: Un expected token '/'. Invalid regular expression.18 SyntaxError: Un expected token '/'. Invalid regular expression.15 SyntaxError: Unterminated regular expression literal '/[' 16 SyntaxError: Unterminated regular expression literal '/[' 17 SyntaxError: Unterminated regular expression literal '/[' 18 SyntaxError: Unterminated regular expression literal '/[' 19 19 5 20 SyntaxError: Un expected token '/'. Invalid regular expression.20 SyntaxError: Unterminated regular expression literal '/[' 21 21 SyntaxError: Invalid regular expression: unmatched parentheses 22 22 --- 4 --- -
trunk/JSTests/ChakraCore/test/es5/Lex_u3.baseline-jsc
r205387 r207798 4 4 str const right 5 5 LS in string - compile failure in ES5: expected.SyntaxError: Unexpected EOF 6 LS in regex literal - compile failure in ES5: expected.SyntaxError: Un expected token '/'. Invalid regular expression.6 LS in regex literal - compile failure in ES5: expected.SyntaxError: Unterminated regular expression literal '/str const regex ' 7 7 LS%20in%20escape%20sequence%20string%20literal%20%20%3Amore%20string 8 8 BOM is WS : 91 -
trunk/JSTests/ChangeLog
r207781 r207798 1 2016-10-24 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 Arrow functions with concise bodies cannot return regular expressions 4 https://bugs.webkit.org/show_bug.cgi?id=163162 5 6 Reviewed by Filip Pizlo. 7 8 * ChakraCore/test/Operators/instanceof.baseline-jsc: 9 * ChakraCore/test/Regex/nul_character.baseline-jsc: 10 * ChakraCore/test/es5/Lex_u3.baseline-jsc: 11 * stress/parse-regexp-as-token.js: Added. 12 (shouldBe): 13 1 14 2016-10-24 Keith Miller <keith_miller@apple.com> 2 15 -
trunk/LayoutTests/ChangeLog
r207797 r207798 1 2016-10-24 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 Arrow functions with concise bodies cannot return regular expressions 4 https://bugs.webkit.org/show_bug.cgi?id=163162 5 6 Reviewed by Filip Pizlo. 7 8 * fast/regex/dom/non-pattern-characters-expected.txt: 9 * js/arrowfunction-syntax-errors-expected.txt: 10 * js/regexp-compile-crash-expected.txt: 11 * sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T1-expected.txt: 12 * sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T4-expected.txt: 13 * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.2_T2-expected.txt: 14 * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T1-expected.txt: 15 * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T3-expected.txt: 16 * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T1-expected.txt: 17 * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T3-expected.txt: 18 * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.2_T1-expected.txt: 19 * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T1-expected.txt: 20 * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T3-expected.txt: 21 * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T1-expected.txt: 22 * sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T3-expected.txt: 23 1 24 2016-10-24 Chris Dumez <cdumez@apple.com> 2 25 -
trunk/LayoutTests/fast/regex/dom/non-pattern-characters-expected.txt
r158014 r207798 34 34 35 35 Testing regexp: [invalid \ variations] 36 PASS /\/ threw exception SyntaxError: Un expected token '/'. Invalid regular expression..37 PASS /a\/ threw exception SyntaxError: Un expected token '/'. Invalid regular expression..36 PASS /\/ threw exception SyntaxError: Unterminated regular expression literal '/\/'. 37 PASS /a\/ threw exception SyntaxError: Unterminated regular expression literal '/a\/'. 38 38 39 39 Testing regexp: /./ … … 81 81 82 82 Testing regexp: [invalid [ variations] 83 PASS /[/ threw exception SyntaxError: Un expected token '/'. Invalid regular expression..84 PASS /a[/ threw exception SyntaxError: Un expected token '/'. Invalid regular expression..83 PASS /[/ threw exception SyntaxError: Unterminated regular expression literal '/[/'. 84 PASS /a[/ threw exception SyntaxError: Unterminated regular expression literal '/a[/'. 85 85 PASS /[b-a]/ threw exception SyntaxError: Invalid regular expression: range out of order in character class. 86 86 PASS /a[b-a]/ threw exception SyntaxError: Invalid regular expression: range out of order in character class. -
trunk/LayoutTests/js/arrowfunction-syntax-errors-expected.txt
r199927 r207798 7 7 PASS x=> threw exception SyntaxError: Unexpected end of script. 8 8 PASS x=>* threw exception SyntaxError: Unexpected token '*'. 9 PASS x=>/ threw exception SyntaxError: Un expected token '/'. Invalid regular expression..9 PASS x=>/ threw exception SyntaxError: Unterminated regular expression literal '/'. 10 10 PASS x=>% threw exception SyntaxError: Unexpected token '%'. 11 11 PASS x=>+ threw exception SyntaxError: Unexpected end of script. … … 33 33 PASS x=>{ threw exception SyntaxError: Unexpected end of script. 34 34 PASS x=>{* threw exception SyntaxError: Unexpected token '*'. 35 PASS x=>{/ threw exception SyntaxError: Un expected token '/'. Invalid regular expression..35 PASS x=>{/ threw exception SyntaxError: Unterminated regular expression literal '/'. 36 36 PASS x=>{% threw exception SyntaxError: Unexpected token '%'. 37 37 PASS x=>{+ threw exception SyntaxError: Unexpected end of script. … … 60 60 PASS var y = x=> threw exception SyntaxError: Unexpected end of script. 61 61 PASS var y = x=>* threw exception SyntaxError: Unexpected token '*'. 62 PASS var y = x=>/ threw exception SyntaxError: Un expected token '/'. Invalid regular expression..62 PASS var y = x=>/ threw exception SyntaxError: Unterminated regular expression literal '/'. 63 63 PASS var y = x=>% threw exception SyntaxError: Unexpected token '%'. 64 64 PASS var y = x=>+ threw exception SyntaxError: Unexpected end of script. … … 86 86 PASS var y = x=>{ threw exception SyntaxError: Unexpected end of script. 87 87 PASS var y = x=>{* threw exception SyntaxError: Unexpected token '*'. 88 PASS var y = x=>{/ threw exception SyntaxError: Un expected token '/'. Invalid regular expression..88 PASS var y = x=>{/ threw exception SyntaxError: Unterminated regular expression literal '/'. 89 89 PASS var y = x=>{% threw exception SyntaxError: Unexpected token '%'. 90 90 PASS var y = x=>{+ threw exception SyntaxError: Unexpected end of script. -
trunk/LayoutTests/js/regexp-compile-crash-expected.txt
r158014 r207798 5 5 6 6 PASS !!/\)[;s]+/ is true 7 PASS /[/ threw exception SyntaxError: Un expected token '/'. Invalid regular expression..8 PASS /[a/ threw exception SyntaxError: Un expected token '/'. Invalid regular expression..9 PASS /[-/ threw exception SyntaxError: Un expected token '/'. Invalid regular expression..7 PASS /[/ threw exception SyntaxError: Unterminated regular expression literal '/[/'. 8 PASS /[a/ threw exception SyntaxError: Unterminated regular expression literal '/[a/'. 9 PASS /[-/ threw exception SyntaxError: Unterminated regular expression literal '/[-/'. 10 10 PASS !!/(a)/ is true 11 11 PASS !!/(a){1,3}/ is true -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T1-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 79: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 79: SyntaxError: Unterminated regular expression literal '/' 2 2 S7.4_A4_T1 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.4_Comments/S7.4_A4_T4-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 79: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 79: SyntaxError: Unterminated regular expression literal '/' 2 2 S7.4_A4_T4 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.2_T2-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 77: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 77: SyntaxError: Unterminated regular expression literal '/\/' 2 2 S7.8.5_A1.2_T2 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T1-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 77: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 77: SyntaxError: Unterminated regular expression literal '/' 2 2 S7.8.5_A1.3_T1 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.3_T3-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 77: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 77: SyntaxError: Unterminated regular expression literal '/' 2 2 S7.8.5_A1.3_T3 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T1-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 77: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 77: SyntaxError: Unterminated regular expression literal '/\' 2 2 S7.8.5_A1.5_T1 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A1.5_T3-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 77: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 77: SyntaxError: Unterminated regular expression literal '/\' 2 2 S7.8.5_A1.5_T3 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.2_T1-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 77: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 77: SyntaxError: Unterminated regular expression literal '/a\/' 2 2 S7.8.5_A2.2_T1 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T1-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 77: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 77: SyntaxError: Unterminated regular expression literal '/a' 2 2 S7.8.5_A2.3_T1 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.3_T3-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 77: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 77: SyntaxError: Unterminated regular expression literal '/a' 2 2 S7.8.5_A2.3_T3 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T1-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 77: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 77: SyntaxError: Unterminated regular expression literal '/a\' 2 2 S7.8.5_A2.5_T1 3 3 -
trunk/LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A2.5_T3-expected.txt
r158014 r207798 1 CONSOLE MESSAGE: line 77: SyntaxError: Un expected token '/'. Invalid regular expression.1 CONSOLE MESSAGE: line 77: SyntaxError: Unterminated regular expression literal '/a\' 2 2 S7.8.5_A2.5_T3 3 3 -
trunk/Source/JavaScriptCore/ChangeLog
r207794 r207798 1 2016-10-24 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 Arrow functions with concise bodies cannot return regular expressions 4 https://bugs.webkit.org/show_bug.cgi?id=163162 5 6 Reviewed by Filip Pizlo. 7 8 When we encounter the RegExp in the parser, we first scan it as / or /=. 9 And if / or /= is parsed under the primary expression context, we rescan it 10 as RegExp. However, we did not update the token record information. So the 11 token record still says "I'm / or /=". 12 13 When we parse the string "() => /hello/", the last token becomes "/", which is 14 the first character of the RegExp, instead of "/hello/". Since the arrow 15 function parsing utilizes the end offset of the last token, we accidentally 16 recognize the range of the above arrow function as "() => /". 17 18 In this patch, we update the token when rescanning under the RegExp context. 19 This logic is similar to parsing Tail Template Literal token. 20 21 We also refine the error message for regular expression literals. And since 22 the REGEXP token is now introduced, the other error messages using that token 23 are improved too. 24 25 Currently, unterminated error messages can be seen in Parser.cpp. However, 26 these messages cannot be shown to users if the lexer has m_error. So these 27 code is meaningless. I'll move these tokenizing errors to the lexer in the 28 subsequent patch[1]. 29 30 [1]: https://bugs.webkit.org/show_bug.cgi?id=163928 31 32 * parser/Lexer.cpp: 33 (JSC::Lexer<T>::fillTokenInfo): 34 (JSC::Lexer<T>::lex): 35 (JSC::Lexer<T>::scanRegExp): 36 (JSC::Lexer<T>::scanTrailingTemplateString): 37 (JSC::Lexer<T>::skipRegExp): Deleted. 38 * parser/Lexer.h: 39 (JSC::Lexer::getToken): 40 * parser/Parser.cpp: 41 (JSC::Parser<LexerType>::parseAssignmentExpression): 42 * parser/Parser.h: 43 (JSC::Parser::getToken): 44 * parser/ParserTokens.h: 45 1 46 2016-10-24 Per Arne Vollan <pvollan@apple.com> 2 47 -
trunk/Source/JavaScriptCore/parser/Lexer.cpp
r206333 r207798 1784 1784 1785 1785 template <typename T> 1786 void Lexer<T>::fillTokenInfo(JSToken* tokenRecord, JSTokenType token, int lineNumber, int endOffset, int lineStartOffset, JSTextPosition endPosition) 1787 { 1788 JSTokenLocation* tokenLocation = &tokenRecord->m_location; 1789 tokenLocation->line = lineNumber; 1790 tokenLocation->endOffset = endOffset; 1791 tokenLocation->lineStartOffset = lineStartOffset; 1792 ASSERT(tokenLocation->endOffset >= tokenLocation->lineStartOffset); 1793 tokenRecord->m_endPosition = endPosition; 1794 m_lastToken = token; 1795 } 1796 1797 template <typename T> 1786 1798 JSTokenType Lexer<T>::lex(JSToken* tokenRecord, unsigned lexerFlags, bool strictMode) 1787 1799 { … … 1796 1808 JSTokenType token = ERRORTOK; 1797 1809 m_terminator = false; 1798 1799 auto fillTokenInfo = [&] (int lineNumber, int endOffset, int lineStartOffset, JSTextPosition endPosition) {1800 tokenLocation->line = lineNumber;1801 tokenLocation->endOffset = endOffset;1802 tokenLocation->lineStartOffset = lineStartOffset;1803 ASSERT(tokenLocation->endOffset >= tokenLocation->lineStartOffset);1804 tokenRecord->m_endPosition = endPosition;1805 m_lastToken = token;1806 };1807 1810 1808 1811 start: … … 2313 2316 2314 2317 token = SEMICOLON; 2315 fillTokenInfo( lineNumber, endOffset, lineStartOffset, endPosition);2318 fillTokenInfo(tokenRecord, token, lineNumber, endOffset, lineStartOffset, endPosition); 2316 2319 return token; 2317 2320 } 2318 2321 2319 2322 returnToken: 2320 fillTokenInfo( m_lineNumber, currentOffset(), currentLineStartOffset(), currentPosition());2323 fillTokenInfo(tokenRecord, token, m_lineNumber, currentOffset(), currentLineStartOffset(), currentPosition()); 2321 2324 return token; 2322 2325 2323 2326 returnError: 2324 2327 m_error = true; 2325 fillTokenInfo( m_lineNumber, currentOffset(), currentLineStartOffset(), currentPosition());2328 fillTokenInfo(tokenRecord, token, m_lineNumber, currentOffset(), currentLineStartOffset(), currentPosition()); 2326 2329 RELEASE_ASSERT(token & ErrorTokenFlag); 2327 2330 return token; … … 2341 2344 2342 2345 template <typename T> 2343 bool Lexer<T>::scanRegExp(const Identifier*& pattern, const Identifier*& flags, UChar patternPrefix) 2344 { 2346 JSTokenType Lexer<T>::scanRegExp(JSToken* tokenRecord, UChar patternPrefix) 2347 { 2348 JSTokenData* tokenData = &tokenRecord->m_data; 2345 2349 ASSERT(m_buffer16.isEmpty()); 2346 2350 … … 2359 2363 if (isLineTerminator(m_current) || atEnd()) { 2360 2364 m_buffer16.shrink(0); 2361 return false; 2365 JSTokenType token = UNTERMINATED_REGEXP_LITERAL_ERRORTOK; 2366 fillTokenInfo(tokenRecord, token, m_lineNumber, currentOffset(), currentLineStartOffset(), currentPosition()); 2367 m_error = true; 2368 m_lexErrorMessage = makeString("Unterminated regular expression literal '", getToken(*tokenRecord), "'"); 2369 return token; 2362 2370 } 2363 2371 … … 2390 2398 } 2391 2399 2392 pattern = makeRightSizedIdentifier(m_buffer16.data(), m_buffer16.size(), charactersOredTogether);2400 tokenData->pattern = makeRightSizedIdentifier(m_buffer16.data(), m_buffer16.size(), charactersOredTogether); 2393 2401 2394 2402 m_buffer16.shrink(0); … … 2401 2409 } 2402 2410 2403 flags = makeRightSizedIdentifier(m_buffer16.data(), m_buffer16.size(), charactersOredTogether);2411 tokenData->flags = makeRightSizedIdentifier(m_buffer16.data(), m_buffer16.size(), charactersOredTogether); 2404 2412 m_buffer16.shrink(0); 2405 2413 2406 return true; 2407 } 2408 2409 template <typename T> 2410 bool Lexer<T>::skipRegExp() 2411 { 2412 bool lastWasEscape = false; 2413 bool inBrackets = false; 2414 2415 while (true) { 2416 if (isLineTerminator(m_current) || atEnd()) 2417 return false; 2418 2419 T prev = m_current; 2420 2421 shift(); 2422 2423 if (prev == '/' && !lastWasEscape && !inBrackets) 2424 break; 2425 2426 if (lastWasEscape) { 2427 lastWasEscape = false; 2428 continue; 2429 } 2430 2431 switch (prev) { 2432 case '[': 2433 inBrackets = true; 2434 break; 2435 case ']': 2436 inBrackets = false; 2437 break; 2438 case '\\': 2439 lastWasEscape = true; 2440 break; 2441 } 2442 } 2443 2444 while (isIdentPart(m_current)) 2445 shift(); 2446 2447 return true; 2414 // Since RegExp always ends with /, m_atLineStart always becomes false. 2415 m_atLineStart = false; 2416 2417 JSTokenType token = REGEXP; 2418 fillTokenInfo(tokenRecord, token, m_lineNumber, currentOffset(), currentLineStartOffset(), currentPosition()); 2419 return token; 2448 2420 } 2449 2421 … … 2452 2424 { 2453 2425 JSTokenData* tokenData = &tokenRecord->m_data; 2454 JSTokenLocation* tokenLocation = &tokenRecord->m_location;2455 2426 ASSERT(!m_error); 2456 2427 ASSERT(m_buffer16.isEmpty()); … … 2463 2434 token = result == StringUnterminated ? UNTERMINATED_TEMPLATE_LITERAL_ERRORTOK : INVALID_TEMPLATE_LITERAL_ERRORTOK; 2464 2435 m_error = true; 2465 } else {2436 } else 2466 2437 token = TEMPLATE; 2467 m_lastToken = token;2468 }2469 2438 2470 2439 // Since TemplateString always ends with ` or }, m_atLineStart always becomes false. 2471 2440 m_atLineStart = false; 2472 2473 // Adjust current tokenLocation data for TemplateString. 2474 tokenLocation->line = m_lineNumber; 2475 tokenLocation->endOffset = currentOffset(); 2476 tokenLocation->lineStartOffset = currentLineStartOffset(); 2477 ASSERT(tokenLocation->endOffset >= tokenLocation->lineStartOffset); 2478 tokenRecord->m_endPosition = currentPosition(); 2441 fillTokenInfo(tokenRecord, token, m_lineNumber, currentOffset(), currentLineStartOffset(), currentPosition()); 2479 2442 return token; 2480 2443 } -
trunk/Source/JavaScriptCore/parser/Lexer.h
r206525 r207798 76 76 int lastLineNumber() const { return m_lastLineNumber; } 77 77 bool prevTerminator() const { return m_terminator; } 78 bool scanRegExp(const Identifier*& pattern, const Identifier*& flags, UChar patternPrefix = 0);78 JSTokenType scanRegExp(JSToken*, UChar patternPrefix = 0); 79 79 enum class RawStringsBuildMode { BuildRawStrings, DontBuildRawStrings }; 80 80 JSTokenType scanTrailingTemplateString(JSToken*, RawStringsBuildMode); 81 bool skipRegExp();82 81 83 82 // Functions for use after parsing. … … 116 115 JSTokenType lexExpectIdentifier(JSToken*, unsigned, bool strictMode); 117 116 117 ALWAYS_INLINE StringView getToken(const JSToken& token) 118 { 119 SourceProvider* sourceProvider = m_source->provider(); 120 ASSERT_WITH_MESSAGE(token.m_location.startOffset <= token.m_location.endOffset, "Calling this function with the baked token."); 121 return sourceProvider->getRange(token.m_location.startOffset, token.m_location.endOffset); 122 } 123 118 124 private: 119 125 void record8(int); … … 181 187 template <unsigned length> 182 188 ALWAYS_INLINE bool consume(const char (&input)[length]); 189 190 void fillTokenInfo(JSToken*, JSTokenType, int lineNumber, int endOffset, int lineStartOffset, JSTextPosition endPosition); 183 191 184 192 static const size_t initialReadBufferCapacity = 32; -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r207628 r207798 4307 4307 case DIVIDE: { 4308 4308 /* regexp */ 4309 const Identifier* pattern;4310 const Identifier* flags;4311 4309 if (match(DIVEQUAL)) 4312 failIfFalse(m_lexer->scanRegExp(pattern, flags, '='), "Invalid regular expression");4310 m_token.m_type = m_lexer->scanRegExp(&m_token, '='); 4313 4311 else 4314 failIfFalse(m_lexer->scanRegExp(pattern, flags), "Invalid regular expression"); 4315 4312 m_token.m_type = m_lexer->scanRegExp(&m_token); 4313 matchOrFail(REGEXP, "Invalid regular expression"); 4314 4315 const Identifier* pattern = m_token.m_data.pattern; 4316 const Identifier* flags = m_token.m_data.flags; 4316 4317 JSTextPosition start = tokenStartPosition(); 4317 4318 JSTokenLocation location(tokenLocation()); -
trunk/Source/JavaScriptCore/parser/Parser.h
r206653 r207798 1289 1289 1290 1290 void printUnexpectedTokenText(WTF::PrintStream&); 1291 ALWAYS_INLINE StringView getToken() {1292 SourceProvider* sourceProvider = m_source->provider();1293 return sourceProvider->getRange(tokenStart(), tokenEndPosition().offset);1291 ALWAYS_INLINE StringView getToken() 1292 { 1293 return m_lexer->getToken(m_token); 1294 1294 } 1295 1295 -
trunk/Source/JavaScriptCore/parser/ParserTokens.h
r206525 r207798 97 97 STRING, 98 98 TEMPLATE, 99 REGEXP, 99 100 SEMICOLON, 100 101 COLON, … … 167 168 UNTERMINATED_BINARY_NUMBER_ERRORTOK = 12 | ErrorTokenFlag | UnterminatedErrorTokenFlag, 168 169 UNTERMINATED_TEMPLATE_LITERAL_ERRORTOK = 13 | ErrorTokenFlag | UnterminatedErrorTokenFlag, 169 INVALID_TEMPLATE_LITERAL_ERRORTOK = 14 | ErrorTokenFlag, 170 UNTERMINATED_REGEXP_LITERAL_ERRORTOK = 14 | ErrorTokenFlag | UnterminatedErrorTokenFlag, 171 INVALID_TEMPLATE_LITERAL_ERRORTOK = 15 | ErrorTokenFlag, 170 172 }; 171 173 … … 200 202 bool isTail; 201 203 }; 204 struct { 205 const Identifier* pattern; 206 const Identifier* flags; 207 }; 202 208 }; 203 209
Note: See TracChangeset
for help on using the changeset viewer.