protoblast
Advanced tools
Comparing version 0.8.2 to 0.8.3
@@ -0,1 +1,9 @@ | ||
## 0.8.3 (2023-01-30) | ||
* Automatically handle `ECONNRESET` errors because of keep-alive requests | ||
* Add `Blast.listToTree()` method | ||
* Add the `force` argument to `Blast.createStaticDefiner(target, force)` | ||
* Fix loading invalid extra files causing an error on the client side | ||
* Fix self-closing HTML tags without whitespace not being parsed properly nu `String.tokenizeHTML()` | ||
## 0.8.2 (2023-01-24) | ||
@@ -2,0 +10,0 @@ |
@@ -858,9 +858,10 @@ module.exports = function BlastInitLoader(modifyPrototype) { | ||
* @since 0.8.0 | ||
* @version 0.8.0 | ||
* @version 0.8.3 | ||
* | ||
* @param {String|Function} target The object to add the property to | ||
* @param {Boolean} force Force set it? | ||
*/ | ||
Blast.createStaticDefiner = function createStaticDefiner(target) { | ||
Blast.createStaticDefiner = function createStaticDefiner(target, force) { | ||
return function staticDefiner(name, value, shim) { | ||
return Blast.defineStatic(target, ...arguments); | ||
return Blast.defineStatic(target, name, value, shim, force); | ||
} | ||
@@ -889,3 +890,3 @@ }; | ||
* @since 0.1.0 | ||
* @version 0.8.1 | ||
* @version 0.8.3 | ||
* | ||
@@ -896,4 +897,5 @@ * @param {Object} target The object to add the property to | ||
* @param {Boolean} shim Only set value if it's not already there | ||
* @param {Boolean} force Force-set it? | ||
*/ | ||
Blast.defineStatic = function defineStatic(targetClass, name, value, shim) { | ||
Blast.defineStatic = function defineStatic(targetClass, name, value, shim, force) { | ||
@@ -950,5 +952,5 @@ var objTarget, | ||
// Honour the 'modifyPrototype' setting, except for classes we created ourselves | ||
if (Blast.modifyPrototype || (targetClass && targetClass.setMethod)) { | ||
if (force || Blast.modifyPrototype || (targetClass && targetClass.setMethod)) { | ||
// Only set if it's not a shim, or if it's not there | ||
if (!shim || !targetClass.hasOwnProperty(name)) { | ||
if (force || !shim || !targetClass.hasOwnProperty(name)) { | ||
Blast.defineValue(targetClass, name, value); | ||
@@ -1521,12 +1523,4 @@ } | ||
Blast.require('symbol', { | ||
server : false, | ||
versions : { | ||
chrome : {max: 37}, | ||
edge : {max: 0}, | ||
firefox : {max: 35}, | ||
opera : {max: 24}, | ||
safari : {max: 8} | ||
} | ||
}); | ||
// Load the extra blast functions | ||
Blast.require('blast', {is_extra: false}); | ||
@@ -1533,0 +1527,0 @@ // Load the inheritance methods |
@@ -511,2 +511,3 @@ const OriginalAgent = require('http').Agent; | ||
if (this.freeSockets[name] && this.freeSockets[name].indexOf(socket) !== -1) { | ||
// free socket timeout, destroy quietly | ||
@@ -513,0 +514,0 @@ socket.destroy(); |
@@ -178,3 +178,3 @@ var dns_cache, | ||
* @since 0.2.0 | ||
* @version 0.8.2 | ||
* @version 0.8.3 | ||
*/ | ||
@@ -195,6 +195,9 @@ Request.setMethod(function _make_request(options) { | ||
if (options) { | ||
if (!options) { | ||
options = {}; | ||
} | ||
if (options.url) { | ||
url = options.url; | ||
} else { | ||
options = {}; | ||
url = this.url; | ||
@@ -363,2 +366,11 @@ | ||
this.outgoing_req.on('error', function onRequestError(err) { | ||
// Handle keep-alive errors (where the server closes a socket | ||
// just as we want to re-use it) | ||
if (err.code === 'ECONNRESET' && that.outgoing_req.reusedSocket) { | ||
that.retries++; | ||
pledge.resolve(that._make_request(options)); | ||
return; | ||
} | ||
done(err); | ||
@@ -365,0 +377,0 @@ }); |
@@ -10,5 +10,5 @@ const ORIGINAL_REQUEST = Symbol('ori_req'), | ||
* | ||
* @author Jelle De Loecker <jelle@develry.be> | ||
* @author Jelle De Loecker <jelle@elevenways.be> | ||
* @since 0.2.0 | ||
* @version 0.7.0 | ||
* @version 0.8.3 | ||
* | ||
@@ -34,2 +34,8 @@ * @param {Object|RURL} options | ||
// Keep track of number of retries (ECONNRESET handling) | ||
this.retries = 0; | ||
// Did this come from the cache? | ||
this.from_cache = false; | ||
// Store the original requested url (as string) | ||
@@ -580,3 +586,3 @@ this.original_url = ''; | ||
* @since 0.7.10 | ||
* @version 0.7.10 | ||
* @version 0.8.3 | ||
* | ||
@@ -612,2 +618,3 @@ * @param {Pledge} cached_pledge The Pledge gotten from the cache | ||
this.time_ended = Date.now(); | ||
this.from_cache = true; | ||
@@ -614,0 +621,0 @@ let parsed = this._parseResponse(ori_req.raw_response_body, ori_req.error || err); |
@@ -400,2 +400,7 @@ module.exports = function serverFunctions(Blast, extras) { | ||
// Skip files without a valid name | ||
if (!options.name_id) { | ||
return; | ||
} | ||
client_extras.push([options.name_id, options.arguments]); | ||
@@ -402,0 +407,0 @@ }); |
@@ -475,3 +475,3 @@ const defStat = Blast.createStaticDefiner('String'), | ||
* @since 0.6.5 | ||
* @version 0.7.13 | ||
* @version 0.8.3 | ||
* | ||
@@ -877,2 +877,7 @@ * @param {String source | ||
// Handle self-closing tags without whitespace, like <br/> | ||
if (state === STATE.TAG_NAME && char === '/') { | ||
state = STATE.TAG_CONTENT; | ||
} | ||
if (!char.trim()) { | ||
@@ -879,0 +884,0 @@ if (!current || current.type != 'whitespace') { |
{ | ||
"name": "protoblast", | ||
"description": "Native object expansion library", | ||
"version": "0.8.2", | ||
"version": "0.8.3", | ||
"author": "Jelle De Loecker <jelle@elevenways.be>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
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
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
782319
61
32360