Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/typedObjects/objectTypes.js

Issue 29323484: Issue 507 - Implement lightweight array.slice() method (Closed)
Patch Set: Small improvements Created Aug. 19, 2015, 12:14 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/typedObjects/arrayTypes.js ('k') | test/tests/typedObjects.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/typedObjects/objectTypes.js
diff --git a/lib/typedObjects/objectTypes.js b/lib/typedObjects/objectTypes.js
index 4fa97d40e33681a8a60b05b9b4d26c898907d3ea..e7b5d9aa43c44922af7337a0d3e4135359ebe50c 100644
--- a/lib/typedObjects/objectTypes.js
+++ b/lib/typedObjects/objectTypes.js
@@ -81,10 +81,17 @@ function free(obj)
}
finally
{
- for (let [prop, value] of this.initialValues)
- obj[prop] = value;
+ if (obj._copy)
+ {
+ Object.getPrototypeOf(obj).release();
+ }
+ else
+ {
+ for (let [prop, value] of this.initialValues)
+ obj[prop] = value;
- dealloc(this.firstFree, obj.bufferIndex, obj.byteOffset);
+ dealloc(this.firstFree, obj.bufferIndex, obj.byteOffset);
+ }
}
}
« no previous file with comments | « lib/typedObjects/arrayTypes.js ('k') | test/tests/typedObjects.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld