wallet-core/node_modules/babel-plugin-espower/lib/power-assert-recorder.js

27 lines
596 B
JavaScript
Raw Normal View History

2017-05-28 00:38:50 +02:00
'use strict';
module.exports = /* intentional newline */
function () {
function PowerAssertRecorder() {
this.captured = [];
}
PowerAssertRecorder.prototype._capt = function _capt (value, espath) {
this.captured.push({value: value, espath: espath});
return value;
};
PowerAssertRecorder.prototype._expr = function _expr (value, source) {
var capturedValues = this.captured;
this.captured = [];
return {
powerAssertContext: {
value: value,
events: capturedValues
},
source: source
};
};
return PowerAssertRecorder;
}