From 6d76e2009091d9997c0a692b4fc983112d889653 Mon Sep 17 00:00:00 2001 From: hotoo Date: Tue, 9 Sep 2014 11:15:25 +0800 Subject: [PATCH] Update share one object for check type. --- src/util-lang.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util-lang.js b/src/util-lang.js index d5ed5c64..8e11c743 100644 --- a/src/util-lang.js +++ b/src/util-lang.js @@ -2,9 +2,11 @@ * util-lang.js - The minimal language enhancement */ +var _object = {} + function isType(type) { return function(obj) { - return {}.toString.call(obj) == "[object " + type + "]" + return _object.toString.call(obj) == "[object " + type + "]" } } @@ -17,4 +19,3 @@ var _cid = 0 function cid() { return _cid++ } -