Skip to content

Commit

Permalink
Fix a bug in speedups when regexp were used in prototype (like in Mor…
Browse files Browse the repository at this point in the history
…e/URI)
  • Loading branch information
Inviz committed Mar 23, 2011
1 parent 013eaae commit 3cc7fcd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/Core/Class.Speedups.js
Expand Up @@ -45,6 +45,7 @@ var parent = function(){


var indexOf = Array.prototype.indexOf;
var exec = RegExp.prototype.exec;
//Speedup1: Avoid typeOf in reset

// before:
Expand All @@ -56,7 +57,7 @@ var indexOf = Array.prototype.indexOf;
var reset = function(object){
for (var key in object){
var value = object[key];
if (value && typeof(value) == 'object') {
if (value && typeof(value) == 'object' && value.exec != exec) {
if (value.indexOf != indexOf) {
var F = function(){};
F.prototype = value;
Expand Down

0 comments on commit 3cc7fcd

Please sign in to comment.