mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Implement a more robust native function detection. [Krinkle]
Former-commit-id: 8d915a0dd12f08e1860122189b57b12382efb144
This commit is contained in:
@@ -46,7 +46,9 @@
|
||||
var reInterpolateDelimiter = /<%=([\s\S]+?)%>/g;
|
||||
|
||||
/** Used to detect if a method is native */
|
||||
var reNative = /\{\s*\[native code\]\s*\}/;
|
||||
var reNative = RegExp('^' + ({}.valueOf + '')
|
||||
.replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&')
|
||||
.replace(/valueOf/g, '.+?') + '$')
|
||||
|
||||
/** Used to match tokens in template text */
|
||||
var reToken = /__token__(\d+)/g;
|
||||
|
||||
Reference in New Issue
Block a user