Improve regexp for reNative.

This commit is contained in:
John-David Dalton
2013-12-16 19:55:19 -08:00
parent 98566150d2
commit 42bccfe1ec

View File

@@ -499,7 +499,7 @@
var reNative = RegExp('^' +
String(toString)
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
.replace(/toString| for [^\]]+/g, '.*?') + '$'
.replace(/\b(function)\b.*?(?=\\\()| for .+?(?=\\\])|\btoString\b/g, '$1.*?') + '$'
);
/** Native method shortcuts */