firepad icon indicating copy to clipboard operation
firepad copied to clipboard

this.aceRange.fromPoints is not a function

Open adamjimenez opened this issue 9 years ago • 1 comments

I'm getting this error after running through require.js optimiser and then pressing undo (ctrl-z) when editing.

this.aceRange.fromPoints is not a function

I tracked it down to this line:

this.aceRange = ((_ref = ace.require) != null ? _ref : require)("ace/range").Range;

Which get's optimised to:

this.aceRange==null&&(this.aceRange=(n=ace.require)!=null?n:require("ace/range").Range

Which ends up turning the value of this.aceRange into ace.require

I can fix it by editing the js to:

      _ref = ace.require ? ace.require : require;
      this.aceRange = _ref("ace/range").Range; 

But the coffeescript will need to be tweaked also.

adamjimenez avatar Jan 15 '16 19:01 adamjimenez

What does require.js optimizer do? It looks like it's both making that line longer and breaking it? :-)

Anyway, I'd welcome a PR to address this somehow.

mikelehen avatar Jan 15 '16 19:01 mikelehen