From 28b3da738bc7a310d118da9fe3b51995fd50a7db Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Fri, 11 Mar 2016 15:53:09 +0800 Subject: [PATCH] minor tweaks --- cocos2d/core/platform/preprocess-attrs.js | 10 +++++----- jsb/jsb-loader.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos2d/core/platform/preprocess-attrs.js b/cocos2d/core/platform/preprocess-attrs.js index 16f134b56e..059cf95b0d 100644 --- a/cocos2d/core/platform/preprocess-attrs.js +++ b/cocos2d/core/platform/preprocess-attrs.js @@ -170,16 +170,16 @@ module.exports = function (properties, className, cls) { }; } else if (typeof val === 'function') { - if (cc.isChildClassOf(val, cc.ValueType)) { - //noinspection JSUnresolvedFunction + if (cc.RawAsset.isRawAssetType(val)) { val = { - default: new val(), - type: val + default: '', + url: val }; } else { val = { - default: cc.RawAsset.isRawAssetType(val) ? '' : null, + //noinspection JSUnresolvedFunction + default: cc.isChildClassOf(val, cc.ValueType) ? (new val()) : null, type: val }; } diff --git a/jsb/jsb-loader.js b/jsb/jsb-loader.js index 388d513451..a3577bb15a 100644 --- a/jsb/jsb-loader.js +++ b/jsb/jsb-loader.js @@ -41,7 +41,7 @@ function downloadText (item, callback) { url = cc.Pipeline.UrlResolver.getRawUrl(url); var result = jsb.fileUtils.getStringFromFile(url); - if (result && typeof result === 'string') { + if (typeof result === 'string' && result) { callback(null, result); } else {