Skip to content

Commit ef88457

Browse files
committed
fix break in node 8
1 parent de2af97 commit ef88457

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ function CipherBase (hashMode) {
1111
} else {
1212
this.final = this._finalOrDigest
1313
}
14+
if (this._final) {
15+
this.__final = this._final
16+
this._final = null
17+
}
1418
this._decoder = null
1519
this._encoding = null
1620
}
@@ -59,15 +63,15 @@ CipherBase.prototype._transform = function (data, _, next) {
5963
CipherBase.prototype._flush = function (done) {
6064
var err
6165
try {
62-
this.push(this._final())
66+
this.push(this.__final())
6367
} catch (e) {
6468
err = e
6569
} finally {
6670
done(err)
6771
}
6872
}
6973
CipherBase.prototype._finalOrDigest = function (outputEnc) {
70-
var outData = this._final() || new Buffer('')
74+
var outData = this.__final() || new Buffer('')
7175
if (outputEnc) {
7276
outData = this._toString(outData, outputEnc, true)
7377
}

0 commit comments

Comments
 (0)