#298 improve object detection
This commit is contained in:
parent
a4c98e63e8
commit
d020d7f4b9
1 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
Mithril = m = new function app(window, undefined) {
|
Mithril = m = new function app(window, undefined) {
|
||||||
var sObj = "[object Object]", sArr = "[object Array]", sStr = "[object String]"
|
var sObj = "[object Object]", sArr = "[object Array]", sStr = "[object String]"
|
||||||
function type(obj) {return {}.toString.call(obj)}
|
function type(obj) {return {}.toString.call(obj)}
|
||||||
function isObj(obj) {return type(obj) == sObj}
|
function isObj(obj) {return obj != null && type(obj) == sObj}
|
||||||
function isArr(obj) {return type(obj) == sArr}
|
function isArr(obj) {return type(obj) == sArr}
|
||||||
function isFn(obj) {return typeof obj == "function"}
|
function isFn(obj) {return typeof obj == "function"}
|
||||||
function isStr(obj){ return type(obj) == sStr}
|
function isStr(obj){ return type(obj) == sStr}
|
||||||
|
|
@ -812,7 +812,7 @@ Mithril = m = new function app(window, undefined) {
|
||||||
var script = window.document.createElement("script")
|
var script = window.document.createElement("script")
|
||||||
|
|
||||||
window[callbackKey] = function(resp){
|
window[callbackKey] = function(resp){
|
||||||
delete window[callbackKey]
|
window[callbackKey] = undefined
|
||||||
window.document.body.removeChild(script)
|
window.document.body.removeChild(script)
|
||||||
options.onload({
|
options.onload({
|
||||||
type: "load",
|
type: "load",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue