Skip to content

Commit 5611806

Browse files
committed
Return Uint8Array in BinaryLoader (keep consistency)
1 parent 0d8d514 commit 5611806

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: cocos2d/core/utils/BinaryLoader.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ cc.loader.loadBinary = function (url, cb) {
5050
} else {
5151
if (xhr.overrideMimeType) xhr.overrideMimeType("text\/plain; charset=x-user-defined");
5252
xhr.onload = function () {
53-
xhr.readyState === 4 && xhr.status === 200 ? cb(null, xhr.response) : cb(errInfo);
53+
xhr.readyState === 4 && xhr.status === 200 ? cb(null, new Uint8Array(xhr.response)) : cb(errInfo);
5454
};
5555
}
5656
xhr.send(null);
@@ -104,7 +104,7 @@ cc.loader.loadBinarySync = function (url) {
104104
return null;
105105
}
106106

107-
arrayInfo = req.response;
107+
arrayInfo = new Uint8Array(req.response);
108108
}
109109
return arrayInfo;
110110
};

0 commit comments

Comments
 (0)