Add-on does not work on Firefox 45

I noticed that the addon I created recently, it works on Firefox version 43, while on 45 it raises an exception in relation to items (i.e. TextEncoder) of resource: //gre/modules/osfile.jsm.

I deduce that in the 45 something must have changed. In practice I can no longer do the appending to a text file.

Programming in a condition like that is frustrating. Can you please give me explanations and possible suggestions?

Edit: I found some information here

The exception emphasizes the need for “new” in TextEncoder. However I have no idea how to change the appendig code, code found on this mdn page

Here the error:

A coding exception was thrown in a Promise resolution callback.
See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise

Full message: TypeError: Constructor TextEncoder requires 'new’
Full stack: logURL/<@resource://gre/modules/commonjs/toolkit/loader.js ->

Edit2: I think (and hope) I have successfully solved with this change to the old code:

var txtEncoded1 = new TextEncoder();
var txtEncoded = txtEncoded1.encode(txtToAppend);

I want to know the reason for this change. I would also like to have a constant and official reference which informs developers of all the changes in a new version of Firefox (any incompatibilities of the code and the solutions to be implemented). Thanks