letsfreezethat
Advanced tools
Comparing version
(function() { | ||
'use strict'; | ||
var d, e, error, fix, freeze, k, lets, thaw; | ||
var d, e, error, fix, freeze, k, lets, log, thaw; | ||
log = console.log; | ||
({lets, freeze, thaw, fix} = require('..')); | ||
@@ -141,2 +143,53 @@ | ||
log('--------------------------------------------------------------------'); | ||
({lets, freeze, thaw, fix} = require('..')); | ||
d = { | ||
x: 'some value' | ||
}; | ||
Object.defineProperty(d, 'time', { | ||
enumerable: true, | ||
configurable: false, | ||
get: function() { | ||
return process.hrtime(); | ||
}, | ||
set: function() { | ||
return log('set not implemented'); | ||
} | ||
}); | ||
log('^887-1', d); | ||
log('^887-2', d.time); | ||
log('^887-3', d.time); | ||
// d.x = 'some other value' | ||
d.time = 42; | ||
log('Object.getOwnPropertyDescriptor', Object.getOwnPropertyDescriptor(d, 'time')); | ||
log('--------------------------------------------------------------------'); | ||
d = lets(d); | ||
// log '^335-1', Object.isFrozen d | ||
Object.freeze(d); | ||
log('Object.getOwnPropertyDescriptor', Object.getOwnPropertyDescriptor(d, 'time')); | ||
log('^887-4', d); | ||
log('^887-5', d.time); | ||
log('^887-6', d.time); | ||
// d.x = 'some third value' | ||
// d.time = 42 | ||
log('^887-7', d); | ||
log('^887-8', d.time); | ||
}).call(this); |
@@ -81,3 +81,3 @@ (function() { | ||
value = x[key]; | ||
R[key] = thaw(value); | ||
R[key] = _thaw(value); | ||
} | ||
@@ -117,5 +117,6 @@ return R; | ||
fix, | ||
nofreeze: require('./nofreeze') | ||
nofreeze: require('./nofreeze'), | ||
partial: require('./partial') | ||
}; | ||
}).call(this); |
{ | ||
"name": "letsfreezethat", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "An utterly minimal immutability library in the spirit of immer", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
53514
112.08%18
50%723
164.84%