Comparing version 0.8.3 to 0.8.4
{ | ||
"name": "fastdom", | ||
"description": "Eliminates layout thrashing by batching DOM read/write operations", | ||
"version": "0.8.3", | ||
"version": "0.8.4", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": [ |
{ | ||
"name": "fastdom", | ||
"description": "Eliminates layout thrashing by batching DOM read/write operations", | ||
"version": "0.8.3", | ||
"version": "0.8.4", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": [ |
0.8.4 / 2013-10-25 | ||
================== | ||
* fix - ensure that exceptions thrown inside a read/write job don't prevent the rest of the jobs being flushed. | ||
0.8.3 / 2013-10-25 | ||
@@ -3,0 +8,0 @@ ================== |
34
index.js
@@ -235,2 +235,3 @@ | ||
var id; | ||
while (id = list.shift()) { | ||
@@ -242,20 +243,31 @@ this.run(this.batch.hash[id]); | ||
/** | ||
* Runs any read jobs followed | ||
* by any write jobs. | ||
* Runs any 'read' jobs followed | ||
* by any 'write' jobs. | ||
* | ||
* We run this inside a try catch | ||
* so that if any jobs error, we | ||
* are able to recover and continue | ||
* to flush the batch until it's empty. | ||
* | ||
* @api private | ||
*/ | ||
FastDom.prototype.runBatch = function() { | ||
try { | ||
// Set the mode to 'reading', | ||
// then empty all read jobs | ||
this.batch.mode = 'reading'; | ||
this.flush(this.batch.read); | ||
// Set the mode to 'reading', | ||
// then empty all read jobs | ||
this.batch.mode = 'reading'; | ||
this.flush(this.batch.read); | ||
// Set the mode to 'writing' | ||
// then empty all write jobs | ||
this.batch.mode = 'writing'; | ||
this.flush(this.batch.write); | ||
// Set the mode to 'writing' | ||
// then empty all write jobs | ||
this.batch.mode = 'writing'; | ||
this.flush(this.batch.write); | ||
this.batch.mode = null; | ||
this.batch.mode = null; | ||
} catch (e) { | ||
this.runBatch(); | ||
throw e; | ||
} | ||
}; | ||
@@ -262,0 +274,0 @@ |
{ | ||
"name": "fastdom", | ||
"description": "Eliminates layout thrashing by batching DOM read/write operations", | ||
"version": "0.8.3", | ||
"version": "0.8.4", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
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
16777
396