early reporting of malformed regex literals

# Allen Wirfs-Brock (17 years ago)

In your comments on the June 11, ES3.1 draft you said:

p22 7.8. Unacceptable change: The requirement to signal regular

expression syntax errors at scanning time breaks existing programs.

(The justification ("since the arguments are the same every tine[sic],

..." appears to have no bearing on that and should be removed in any

case.)

If the existing browser implementations don't do this, would you agree it would be better to simply eliminate the scanning time option?

Presumably, it would be acceptable to require early report in an opt-in "strict mode"

# Lars Hansen (17 years ago)

It's reasonably clear that reporting errors at scanning time will affect current web content negatively. It's not clear it breaks non-web implementations (like ActionScript). The option of reporting it early might be OK to keep, but IMO it could probably be removed without much hardship to anyone. I don't know why it would be important to remove the option, though.

In my opinion strict mode should not be about changes to the language syntax but about improving run-time error checking, so I don't think it's reasonable to require an early error report in strict mode. I do see the value of doing so, but leaving syntax out of strict mode is more valuable to me.

--lars

PS. I'll be replying to mail only intermittently during the next three weeks.

From: Allen Wirfs-Brock [mailto:Allen.Wirfs-Brock at microsoft.com] Sent: 28. juni 2008 00:47 To: Lars Hansen Cc: es3.x-discuss at mozilla.org; es4-discuss at mozilla.org Subject: early reporting of malformed regex literals

In your comments on the June 11, ES3.1 draft you said:

p22 7.8. Unacceptable change: The requirement to signal regular

expression syntax errors at scanning time breaks existing programs.

(The justification ("since the arguments are the same every tine[sic],

..." appears to have no bearing on that and should be removed in any

case.)

If the existing browser implementations don't do this, would you agree it would be better to simply eliminate the scanning time option?

Presumably, it would be acceptable to require early report in an opt-in "strict mode"

# Waldemar Horwat (17 years ago)

Allen Wirfs-Brock wrote:

In your comments on the June 11, ES3.1 draft you said:

p22 7.8. Unacceptable change: The requirement to signal regular

expression syntax errors at scanning time breaks existing programs. (The justification ("since the arguments are the same every tine[sic], ..." appears to have no bearing on that and should be removed in any case.)

If the existing browser implementations don’t do this, would you agree it would be better to simply eliminate the scanning time option?

Presumably, it would be acceptable to require early report in an opt-in “strict mode”

If you intend to allow unescaped slashes inside regular expression literals, then you must report at least some regular expression syntax errors early. There's no way to continue parsing the rest of the program if you don't because you don't know where the regular expression literal ends.

Waldemar