The regex in the `replace` is not good enough as it will not escape `'` characters. A better solution is `JSON.stringify`, which adds enclosing quotes and escapes everything as needed.

The same applies to L255 and L256, you should call `JSON.stringify(this._needsToInject)` instead of manually composing the array string.