Skip to content

Commit

Permalink
Fixed an issue that caused RegExp exceptions on Node.js v4 and earlie…
Browse files Browse the repository at this point in the history
…r versions (#150, #151)
  • Loading branch information
cheton committed Mar 26, 2017
1 parent ae630c4 commit 7e10f4b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/controllers/Grbl/GrblController.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class GrblController {
posc
};

const re = new RegExp(/\[[^\]]+\]/, 'g');
const re = new RegExp(/\[[^\]]+\]/g);
gcode = gcode.replace(re, (match) => {
const expr = match.slice(1, -1);
let result = '[]';
Expand Down
2 changes: 1 addition & 1 deletion src/app/controllers/Smoothie/SmoothieController.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class SmoothieController {
posc
};

const re = new RegExp(/\[[^\]]+\]/, 'g');
const re = new RegExp(/\[[^\]]+\]/g);
gcode = gcode.replace(re, (match) => {
const expr = match.slice(1, -1);
let result = '[]';
Expand Down
2 changes: 1 addition & 1 deletion src/app/controllers/TinyG/TinyGController.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class TinyGController {
posc
};

const re = new RegExp(/\[[^\]]+\]/, 'g');
const re = new RegExp(/\[[^\]]+\]/g);
gcode = gcode.replace(re, (match) => {
const expr = match.slice(1, -1);
let result = '[]';
Expand Down

0 comments on commit 7e10f4b

Please sign in to comment.