Merge pull request #2499 from amaanq/flags-if-exist
fix: don't add flags if they're not present
This commit is contained in:
commit
14cd76c354
1 changed files with 4 additions and 1 deletions
|
|
@ -181,10 +181,13 @@ function normalize(value) {
|
|||
value
|
||||
};
|
||||
case RegExp:
|
||||
return {
|
||||
return value.flags ? {
|
||||
type: 'PATTERN',
|
||||
value: value.source,
|
||||
flags: value.flags
|
||||
} : {
|
||||
type: 'PATTERN',
|
||||
value: value.source
|
||||
};
|
||||
case ReferenceError:
|
||||
throw value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue