From 7472261ca60d4409f670ec52a376a1525900ee15 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 17 Jul 2014 13:22:33 +0200 Subject: eliminate global regex var --- objects.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index eb3f5fc..6e49f43 100644 --- a/objects.js +++ b/objects.js @@ -4084,7 +4084,10 @@ SpriteMorph.prototype.reactToDropOf = function (morph, hand) { morph.slideBackTo(hand.grabOrigin); }; -var re = /\((\d+)\)$/; // RegExp to match costume names +// SpriteMorph screenshots + +SpriteMorph.prototype.re = /\((\d+)\)$/; // RegExp to match costume names + SpriteMorph.prototype.newCostumeName = function (name) { var foundSameName = false, foundIndex = false, @@ -4100,7 +4103,7 @@ SpriteMorph.prototype.newCostumeName = function (name) { foundSameName = true; } if (foundSameName) { - p = re.exec(costume.name); + p = this.re.exec(costume.name); if (p) { lastIndex = Number(p[1]); foundIndex = true; -- cgit v1.3.1