New issue
Advanced search Search tips

Issue 845852 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Eager evaluation doesn't properly check arguments at runtime (String.prototype.split)

Reported by remysh...@gmail.com, May 23 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3437.2 Safari/537.36

Steps to reproduce the problem:
In console with eager eval enabled, type:

1. "this is a phrase"
2. .split(' ')
3. { no response in eager eval }

Trying other examples, it seems to be String.prototype.split that won't return to eager eval

What is the expected behavior?
Should show an array of the results. I can't see that this is having side effects so I'd expect it to work.

What went wrong?
No result show.

Did this work before? N/A 

Chrome version: 68.0.3437.2  Channel: n/a
OS Version: OS X 10.13.4
Flash Version:
 
Labels: Needs-Triage-M68
Owner: l...@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 3 by l...@chromium.org, May 25 2018

Summary: Eager evaluation doesn't properly check arguments at runtime (String.prototype.split) (was: Eager evaluation doesn't respond with .split)
Thanks for the report.  In this case, Array.p.split can modify the argument passed if it is a regex: `string.split(regex); regex.lastMatch`.

We'd need to update the side effect checker to deal with these argument cases and allow:
`string.split(/abc/)` but not `string.split(regex)` when the latter might modify the `lastMatch`.

Sign in to add a comment