The inconsistency in using "this" was because getNewNode was not a member of the Editor prototype. Have made it a class member now, to be consistent with other similar methods like getNodeWithId etc.