Skip to content

Commit

Permalink
fix: Class should be invoked with 'new'
Browse files Browse the repository at this point in the history
fix TypeError: Class constructor AccessToken cannot be invoked without 'new'
  • Loading branch information
zousandian committed Apr 10, 2017
1 parent 2cb232a commit 11993fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/api_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class API {
// 调用用户传入的获取token的异步方法,获得token之后使用(并缓存它)。
var token = await this.getToken();
var accessToken;
if (token && (accessToken = AccessToken(token.accessToken, token.expireTime)).isValid()) {
if (token && (accessToken = new AccessToken(token.accessToken, token.expireTime)).isValid()) {
return accessToken;
}
return this.getAccessToken();
Expand Down

0 comments on commit 11993fc

Please sign in to comment.