TypeScript/tests/baselines/reference/regExpWithSlashInCharClass.js
Daniel Rosenwasser 35803db2e6 Fixed error when parsing slashes in RegExp literals.
Basically we weren't recognizing that a slash can occur in a character class, so we were bailing out too early on code like `/[/]/`.

Fixes issue #318.
2014-07-31 00:36:50 -07:00

11 lines
353 B
JavaScript

//// [regExpWithSlashInCharClass.ts]
var foo1 = "a/".replace(/.[/]/, "");
var foo2 = "a//".replace(/.[//]/g, "");
var foo3 = "a/".replace(/.[/no sleep /till/]/, "bugfix");
//// [regExpWithSlashInCharClass.js]
var foo1 = "a/".replace(/.[/]/, "");
var foo2 = "a//".replace(/.[//]/g, "");
var foo3 = "a/".replace(/.[/no sleep /till/]/, "bugfix");