Bug 196678 - JavaScriptCore stop execute javascript on missing pair bracket
Summary: JavaScriptCore stop execute javascript on missing pair bracket
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-06 06:49 PDT by Yen-Chin, Lee
Modified: 2020-07-18 09:00 PDT (History)
4 users (show)

See Also:


Attachments
TestCase, firefox and Chrome will show green rectangle, webkit keep it red (890 bytes, text/html)
2019-04-06 06:49 PDT, Yen-Chin, Lee
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.