Comparing version 4.0.0-alpha.11 to 4.0.0-alpha.12
@@ -185,3 +185,3 @@ "use strict"; | ||
ENCRYPTED_KEY: null, | ||
VERSION: 'js' + "4.0.0-alpha.11", | ||
VERSION: 'js' + "4.0.0-alpha.12", | ||
APPLICATION_ID: null, | ||
@@ -188,0 +188,0 @@ JAVASCRIPT_KEY: null, |
@@ -379,2 +379,3 @@ "use strict"; | ||
this.socket = new WebSocketImplementation(this.serverURL); | ||
this.socket.closingPromise = (0, _promiseUtils.resolvingPromise)(); | ||
@@ -388,3 +389,4 @@ // Bind WebSocket callbacks | ||
}; | ||
this.socket.onclose = function () { | ||
this.socket.onclose = function (event) { | ||
_this4.socket.closingPromise.resolve(event); | ||
_this4._handleWebSocketClose(); | ||
@@ -430,7 +432,8 @@ }; | ||
* | ||
* @returns {Promise | undefined} CloseEvent {@link https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event} | ||
*/ | ||
}, { | ||
key: "close", | ||
value: function () { | ||
var _context2; | ||
value: function () /*: ?Promise*/{ | ||
var _this$socket, _this$socket2, _context2; | ||
if (this.state === CLIENT_STATE.INITIALIZED || this.state === CLIENT_STATE.DISCONNECTED) { | ||
@@ -440,3 +443,3 @@ return; | ||
this.state = CLIENT_STATE.DISCONNECTED; | ||
this.socket.close(); | ||
(_this$socket = this.socket) === null || _this$socket === void 0 ? void 0 : _this$socket.close(); | ||
// Notify each subscription about the close | ||
@@ -458,2 +461,3 @@ var _iterator = _createForOfIteratorHelper((0, _values.default)(_context2 = this.subscriptions).call(_context2)), | ||
this.emit(CLIENT_EMMITER_TYPES.CLOSE); | ||
return (_this$socket2 = this.socket) === null || _this$socket2 === void 0 ? void 0 : _this$socket2.closingPromise; | ||
} | ||
@@ -460,0 +464,0 @@ |
@@ -20,4 +20,4 @@ "use strict"; | ||
}); | ||
wx.onSocketClose(function () { | ||
_this.onclose(); | ||
wx.onSocketClose(function (event) { | ||
_this.onclose(event); | ||
}); | ||
@@ -24,0 +24,0 @@ wx.onSocketError(function (error) { |
@@ -182,3 +182,3 @@ "use strict"; | ||
ENCRYPTED_KEY: null, | ||
VERSION: 'js' + "4.0.0-alpha.11", | ||
VERSION: 'js' + "4.0.0-alpha.12", | ||
APPLICATION_ID: null, | ||
@@ -185,0 +185,0 @@ JAVASCRIPT_KEY: null, |
@@ -257,2 +257,3 @@ "use strict"; | ||
this.socket = new WebSocketImplementation(this.serverURL); | ||
this.socket.closingPromise = (0, _promiseUtils.resolvingPromise)(); | ||
@@ -266,3 +267,4 @@ // Bind WebSocket callbacks | ||
}; | ||
this.socket.onclose = () => { | ||
this.socket.onclose = event => { | ||
this.socket.closingPromise.resolve(event); | ||
this._handleWebSocketClose(); | ||
@@ -304,4 +306,6 @@ }; | ||
* | ||
* @returns {Promise | undefined} CloseEvent {@link https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event} | ||
*/ | ||
close() { | ||
close() /*: ?Promise*/{ | ||
var _this$socket, _this$socket2; | ||
if (this.state === CLIENT_STATE.INITIALIZED || this.state === CLIENT_STATE.DISCONNECTED) { | ||
@@ -311,3 +315,3 @@ return; | ||
this.state = CLIENT_STATE.DISCONNECTED; | ||
this.socket.close(); | ||
(_this$socket = this.socket) === null || _this$socket === void 0 ? void 0 : _this$socket.close(); | ||
// Notify each subscription about the close | ||
@@ -320,2 +324,3 @@ for (const subscription of this.subscriptions.values()) { | ||
this.emit(CLIENT_EMMITER_TYPES.CLOSE); | ||
return (_this$socket2 = this.socket) === null || _this$socket2 === void 0 ? void 0 : _this$socket2.closingPromise; | ||
} | ||
@@ -322,0 +327,0 @@ |
@@ -15,4 +15,4 @@ "use strict"; | ||
}); | ||
wx.onSocketClose(() => { | ||
this.onclose(); | ||
wx.onSocketClose(event => { | ||
this.onclose(event); | ||
}); | ||
@@ -19,0 +19,0 @@ wx.onSocketError(error => { |
@@ -11,3 +11,3 @@ var config = { | ||
ENCRYPTED_KEY: null, | ||
VERSION: 'js' + "4.0.0-alpha.11", | ||
VERSION: 'js' + "4.0.0-alpha.12", | ||
APPLICATION_ID: null, | ||
@@ -14,0 +14,0 @@ JAVASCRIPT_KEY: null, |
@@ -186,2 +186,3 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
this.socket = new WebSocketImplementation(this.serverURL); | ||
this.socket.closingPromise = (0, _promiseUtils.resolvingPromise)(); | ||
this.socket.onopen = function () { | ||
@@ -193,3 +194,4 @@ _this4._handleWebSocketOpen(); | ||
}; | ||
this.socket.onclose = function () { | ||
this.socket.onclose = function (event) { | ||
_this4.socket.closingPromise.resolve(event); | ||
_this4._handleWebSocketClose(); | ||
@@ -232,2 +234,3 @@ }; | ||
value: function () { | ||
var _this$socket, _this$socket2; | ||
if (this.state === CLIENT_STATE.INITIALIZED || this.state === CLIENT_STATE.DISCONNECTED) { | ||
@@ -237,3 +240,3 @@ return; | ||
this.state = CLIENT_STATE.DISCONNECTED; | ||
this.socket.close(); | ||
(_this$socket = this.socket) == null ? void 0 : _this$socket.close(); | ||
for (var subscription of this.subscriptions.values()) { | ||
@@ -245,2 +248,3 @@ subscription.subscribed = false; | ||
this.emit(CLIENT_EMMITER_TYPES.CLOSE); | ||
return (_this$socket2 = this.socket) == null ? void 0 : _this$socket2.closingPromise; | ||
} | ||
@@ -247,0 +251,0 @@ }, { |
@@ -18,4 +18,4 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
}); | ||
wx.onSocketClose(function () { | ||
_this.onclose(); | ||
wx.onSocketClose(function (event) { | ||
_this.onclose(event); | ||
}); | ||
@@ -22,0 +22,0 @@ wx.onSocketError(function (error) { |
@@ -185,3 +185,3 @@ "use strict"; | ||
ENCRYPTED_KEY: null, | ||
VERSION: 'js' + "4.0.0-alpha.11", | ||
VERSION: 'js' + "4.0.0-alpha.12", | ||
APPLICATION_ID: null, | ||
@@ -188,0 +188,0 @@ JAVASCRIPT_KEY: null, |
@@ -379,2 +379,3 @@ "use strict"; | ||
this.socket = new WebSocketImplementation(this.serverURL); | ||
this.socket.closingPromise = (0, _promiseUtils.resolvingPromise)(); | ||
@@ -388,3 +389,4 @@ // Bind WebSocket callbacks | ||
}; | ||
this.socket.onclose = function () { | ||
this.socket.onclose = function (event) { | ||
_this4.socket.closingPromise.resolve(event); | ||
_this4._handleWebSocketClose(); | ||
@@ -430,7 +432,8 @@ }; | ||
* | ||
* @returns {Promise | undefined} CloseEvent {@link https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event} | ||
*/ | ||
}, { | ||
key: "close", | ||
value: function () { | ||
var _context2; | ||
value: function () /*: ?Promise*/{ | ||
var _this$socket, _this$socket2, _context2; | ||
if (this.state === CLIENT_STATE.INITIALIZED || this.state === CLIENT_STATE.DISCONNECTED) { | ||
@@ -440,3 +443,3 @@ return; | ||
this.state = CLIENT_STATE.DISCONNECTED; | ||
this.socket.close(); | ||
(_this$socket = this.socket) === null || _this$socket === void 0 ? void 0 : _this$socket.close(); | ||
// Notify each subscription about the close | ||
@@ -458,2 +461,3 @@ var _iterator = _createForOfIteratorHelper((0, _values.default)(_context2 = this.subscriptions).call(_context2)), | ||
this.emit(CLIENT_EMMITER_TYPES.CLOSE); | ||
return (_this$socket2 = this.socket) === null || _this$socket2 === void 0 ? void 0 : _this$socket2.closingPromise; | ||
} | ||
@@ -460,0 +464,0 @@ |
@@ -20,4 +20,4 @@ "use strict"; | ||
}); | ||
wx.onSocketClose(function () { | ||
_this.onclose(); | ||
wx.onSocketClose(function (event) { | ||
_this.onclose(event); | ||
}); | ||
@@ -24,0 +24,0 @@ wx.onSocketError(function (error) { |
{ | ||
"name": "parse", | ||
"version": "4.0.0-alpha.11", | ||
"version": "4.0.0-alpha.12", | ||
"description": "Parse JavaScript SDK", | ||
@@ -41,5 +41,5 @@ "homepage": "https://parseplatform.org", | ||
"devDependencies": { | ||
"@babel/core": "7.20.2", | ||
"@babel/plugin-proposal-class-properties": "7.10.1", | ||
"@babel/plugin-transform-flow-comments": "7.10.1", | ||
"@babel/core": "7.20.12", | ||
"@babel/plugin-proposal-class-properties": "7.18.6", | ||
"@babel/plugin-transform-flow-comments": "7.19.0", | ||
"@babel/plugin-transform-flow-strip-types": "7.19.0", | ||
@@ -58,3 +58,3 @@ "@babel/plugin-transform-runtime": "7.19.6", | ||
"babel-eslint": "10.1.0", | ||
"babel-jest": "24.9.0", | ||
"babel-jest": "29.4.1", | ||
"babel-plugin-inline-package-json": "2.0.0", | ||
@@ -82,3 +82,4 @@ "babel-plugin-minify-dead-code-elimination": "0.5.2", | ||
"jasmine-spec-reporter": "7.0.0", | ||
"jest": "24.9.0", | ||
"jest": "29.4.1", | ||
"jest-environment-jsdom": "29.4.1", | ||
"jsdoc": "3.6.3", | ||
@@ -156,6 +157,4 @@ "jsdoc-babel": "0.5.0", | ||
], | ||
"setupFilesAfterEnv": [ | ||
"./setup-jest.js" | ||
] | ||
"testEnvironment": "jsdom" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
5564835
118516
52