hey guys I'm testing out my externs -- Google Closure keeps spitting back the error that it expected a '}' on the last line, but I don't see any reason to put one there
Here's the file it complains about -- on the last line : https://github.com/mikebelanger/cljs-tonejs/blob/master/resources/cljsjs/tonejs/common/Tone.ext.js
I don't know about that, but you can't e.g. assign stuff to Tone.Event.prototype
unless you have created Tone.Event
first
e.g. Tone.Event.prototype.start
will fail unless there is Tone.Event = {};
You can check this by evaluating the file in browser
Just copy the contents into console or something
you can also try running the file in Node, that should probably also give better syntax errors than Closure
@juhoteperi oh so something like Tone.Event.Prototype = function() {}
-> Tone.Event = {};
Probably
@juhoteperi I tried Node and the browser, each gave different errors, which is puzzling.
@juhoteperi I have a feeling that your suspicions are right though, and only the bottom functions should be declared as prototypes. Does that sound right?
Doesn't really matter at all if anything is declared as prototypes
Tone.Multiply.prototype.setValueCurveAtTime
=> Tone.Multiply.setValueCurveAtTime
would work as well
Closure only cares about names
var setValueCurveAtTime = {};
, foo.setValueCurveAtTime = {};
, Tone.Multiply.prototype.setValueCurveAtTime = function() {};
all should result in setValueCurveAtTime
calls being preserved
But the object hierarchy is probably useful for maintaining the extern file
Wait, Atom keeps adding a blank line at the very end of my file, ever time I save. Could that be it?
Shouldn't matter
god how did Javascript become so damn popular
oh so it was an unclosed } in the middle of the file. My bad, but god why do all dubuggers point at the end?
@juhoteperi anyways thanks again