fixes #1724 for heregexen

TODO: DRY up that regex handling code so we don't have a duplicate test/error
This commit is contained in:
Michael Ficarra
2011-09-22 04:39:13 -04:00
parent f4c1b20ec2
commit 52dd348289
3 changed files with 7 additions and 0 deletions

View File

@@ -207,6 +207,9 @@
heregex = match[0], body = match[1], flags = match[2];
if (0 > body.indexOf('#{')) {
re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/');
if (re.match(/^\*/)) {
this.error('regular expressions cannot begin with `*`');
}
this.token('REGEX', "/" + (re || '(?:)') + "/" + flags);
return heregex.length;
}