Bug 196678

Summary: JavaScriptCore stop execute javascript on missing pair bracket
Product: WebKit Reporter: Yen-Chin, Lee <coldnew.tw>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: coldnew.tw, fpizlo, keith_miller, ysuzuki
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
TestCase, firefox and Chrome will show green rectangle, webkit keep it red none

Description Yen-Chin, Lee 2019-04-06 06:49:03 PDT
Created attachment 366886 [details]
TestCase, firefox and Chrome will show green rectangle, webkit keep it red

When javascript missing pair bracket, like following:

    var oldRectangle = $('[id^="rectangle"').parent();

Webkit will stop execute other javascript and throw following error:
 
  [Error] Error: Syntax error, unrecognized expression: [id^="rectangle"
	  error (jquery-1.12.4.min.js:2:12788)
	  tokenize (jquery-1.12.4.min.js:2:18792)
	  select (jquery-1.12.4.min.js:2:21596)
	  fa (jquery-1.12.4.min.js:2:7322)
	  find (jquery-1.12.4.min.js:2:24114)
	  init (jquery-1.12.4.min.js:2:24681)
	  n (jquery-1.12.4.min.js:2:420)
	  Global Code (index.html:25)

If I fixed the javascript syntax to:

    var oldRectangle = $('[id^="rectangle"]').parent();

All error gone.

This is due to WRONG syntax on javascript, but Firefox and Chrome they will fix the javascript syntax and will not throw any error.

The attatchement can test this problem, on Firefox/Chrome the result rectangle is in Green, but use webkit to render it, the color will be Red.
Comment 1 Yen-Chin, Lee 2019-04-06 06:50:20 PDT
This issue may duplicate with #173537, but #173537 can't reproduce this issue.
Comment 2 Yen-Chin, Lee 2020-07-18 09:00:00 PDT
This problem is found on webkitgtk 24 or below version, and fixed on webkitgtk (or the same version in Safari) 26.

The testcase is now show gree rectangle after webkitgtk 26, so closed this issue.