Bug 206840

Summary: Python 3: generate-js-builtins hits SyntaxWarning for "is 0"
Product: WebKit Reporter: Stephan Szabo <stephan.szabo>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, ews-watchlist, jbedard, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Replace use of "is 0" with "== 0". none

Description Stephan Szabo 2020-01-27 13:15:03 PST
After switching up to python 3.8, generate-js-builtins.py hits a SyntaxWarning for the use of "is 0".

Apparently, per https://bugs.python.org/issue34850 this sort of usage happens to work on CPython by accident, but is not guaranteed to work on other python implementation or necessarily continue working in CPython.
The warning suggests replacing is with == for such cases.
Comment 1 Stephan Szabo 2020-01-27 13:23:26 PST
Created attachment 388892 [details]
Replace use of "is 0" with "== 0".
Comment 2 EWS Watchlist 2020-01-27 13:24:09 PST
This patch modifies the JS builtins code generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-builtins-generator-tests --reset-results`)
Comment 3 Blaze Burg 2020-01-27 13:46:24 PST
Comment on attachment 388892 [details]
Replace use of "is 0" with "== 0".

rs=me
Comment 4 WebKit Commit Bot 2020-01-27 15:23:05 PST
Comment on attachment 388892 [details]
Replace use of "is 0" with "== 0".

Clearing flags on attachment: 388892

Committed r255186: <https://trac.webkit.org/changeset/255186>
Comment 5 WebKit Commit Bot 2020-01-27 15:23:06 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2020-01-27 15:24:14 PST
<rdar://problem/58936818>