Skip to content

Commit

Permalink
Merge pull request #113 from livehigh/feat/fix-ie-promise
Browse files Browse the repository at this point in the history
feat:兼容ie promise
  • Loading branch information
carsonxu authored Jun 21, 2021
2 parents c804b41 + 0f286a0 commit 630bd59
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/cos-js-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ var apiWrapper = function (apiName, apiFn) {

var errMsg = checkParams();
var isSync = apiName === 'getAuth' || apiName === 'getObjectUrl';
if (Promise && !isSync && !callback) {
if (window.Promise && !isSync && !callback) {
return new Promise(function (resolve, reject) {
callback = function (err, data) {
err ? reject(err) : resolve(data);
Expand Down Expand Up @@ -2422,7 +2422,7 @@ base.init(COS, task);
advance.init(COS, task);

COS.getAuthorization = util.getAuth;
COS.version = '1.2.13';
COS.version = '1.2.14';

module.exports = COS;

Expand Down
2 changes: 1 addition & 1 deletion dist/cos-js-sdk-v5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cos-js-sdk-v5",
"version": "1.2.13",
"version": "1.2.14",
"description": "JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)",
"main": "index.js",
"types": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/cos.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ base.init(COS, task);
advance.init(COS, task);

COS.getAuthorization = util.getAuth;
COS.version = '1.2.13';
COS.version = '1.2.14';

module.exports = COS;
2 changes: 1 addition & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ var apiWrapper = function (apiName, apiFn) {

var errMsg = checkParams();
var isSync = apiName === 'getAuth' || apiName === 'getObjectUrl';
if (Promise && !isSync && !callback) {
if (window.Promise && !isSync && !callback) {
return new Promise(function (resolve, reject) {
callback = function (err, data) {
err ? reject(err) : resolve(data);
Expand Down

0 comments on commit 630bd59

Please sign in to comment.