Skip to content

Commit

Permalink
Final support fix for node v5
Browse files Browse the repository at this point in the history
  • Loading branch information
patgrasso committed Aug 4, 2016
1 parent 720d12f commit a1c15df
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions spec/cfg-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,18 @@ describe('CFG', () => {
expect(r[0].source).toBe(/\d+/.source);
});

// NOTE: the 'y' flag, or 'sticky' flag, is not supported in node v5. The
// ability to match this flag is retained, but it is not tested here (as it
// will break the build!)
// NOTE: the 'y' flag, or 'sticky' flag, is not supported in node v5.
// Also, RegExp objects in v5 don't have the 'flags' property.
it('captures regex flags (g, i, m) on regex terminal symbols', () => {
r = cfg.rule('factor -> /\\d+/mig');
expect(r[0] instanceof RegExp).toBe(true);
expect(r[0].flags).toBe('gim');
if (r[0].flags !== undefined) {
expect(r[0].flags).toBe('gim');
} else {
expect(r[0].ignoreCase).toBe(true);
expect(r[0].multiline).toBe(true);
expect(r[0].global).toBe(true);
}
});

});
Expand Down

0 comments on commit a1c15df

Please sign in to comment.