You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"crypto.createCipher()._flush" results in an abort #37922
How often does it reproduce? Is there a required condition?
This abort can always be triggered following the steps above.
What is the expected behavior?
I'm not sure this problem is of crypto or streams, but I still suggest setting these internal APIs as private fields or something like that to prevent misuse. If any error occurs, an exception or other similar error-reporting stuff should be thrown. There is no reason to abort the whole node process.
This function MUST NOT be called by application code directly. It should be implemented by child classes, and called by the internal Readable class methods only.
Since you are calling Cipher._flush (Cipher extends Transform) directly from application code, it violates precondition and behavior is not guaranteed.
Historically, there is not so-much built-in OOP language features in JavaScript as other language like C++. We could "emulated" private fields by Symbol field in recent practices. But given the importance of stream module, the request to refactor(or semantic changes? considering "access modifier" is never enforced) may be assessed very carefully.
Activity
Ayase-252 commentedon Mar 26, 2021
As the relevant docs says
Since you are calling
Cipher._flush(CipherextendsTransform) directly from application code, it violates precondition and behavior is not guaranteed.Historically, there is not so-much built-in OOP language features in JavaScript as other language like C++. We could "emulated" private fields by
Symbolfield in recent practices. But given the importance ofstreammodule, the request to refactor(or semantic changes? considering "access modifier" is never enforced) may be assessed very carefully.addaleax commentedon Mar 27, 2021
This is conceptually the same thing as #37884. I'd suggest closing one of them as a duplicate.
aduh95 commentedon Apr 1, 2021
Duplicate of #37884