Skip to content

Commit

Permalink
Escape RegExp curly brace
Browse files Browse the repository at this point in the history
Escape '}' in regular expression for better compatibility with other
JavaScript interpreters. It seems like `Ducktype` is not able to
properly parse `brace-expansion` due to the unescaped curly brace.

See: svaarala/duktape#74
  • Loading branch information
myme committed Feb 11, 2016
1 parent 7129406 commit 034059d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function expand(str, isTop) {
var isOptions = /^(.*,)+(.+)?$/.test(m.body);
if (!isSequence && !isOptions) {
// {a},b}
if (m.post.match(/,.*}/)) {
if (m.post.match(/,.*\}/)) {
str = m.pre + '{' + m.body + escClose + m.post;
return expand(str);
}
Expand Down

0 comments on commit 034059d

Please sign in to comment.