mdaines / grammophone

A tool for analyzing and transforming context-free grammars.
https://mdaines.github.io/grammophone
MIT License
205 stars 23 forks source link

Uncaught TypeError: Function.prototype.toString requires that 'this' be a Function #7

Closed evandrocoan closed 6 years ago

evandrocoan commented 6 years ago

If I use a colon instead of a dot as new line terminator:

S ->     | b I | a P | a;
P -> a P | b I | a;
I -> a I | b P | b;

It throws this error on the Google Chrome Console:

Uncaught TypeError: Function.prototype.toString requires that 'this' be a Function
    at _parseError.toString (<anonymous>)
    at ErrorController.reload (application.js:911)
    at ApplicationController.analyze (application.js:804)
    at HTMLButtonElement.<anonymous> (application.js:956)
    at HTMLButtonElement.dispatch (jquery.js:3)
    at HTMLButtonElement.q.handle (jquery.js:3)
File: application.js:911
900:   _createClass(ErrorController, [{
901:     key: "setDelegate",
902:     value: function setDelegate(delegate) {
903:       this._delegate = delegate;
904:     }
905:   }, {
906:     key: "reload",
907:     value: function reload() {
908:       var error = this._delegate.getError();
909: 
910:       if (typeof error !== "undefined") {
911:         this._element.innerHTML = "<pre>" + this._delegate.getError() + "</pre>";
912:       } else {
913:         this._element.innerHTML = "";
914:       }
915:     }
916:   }]);
917: 
918:   return ErrorController;
919: }();
mdaines commented 6 years ago

04c35f369a9d6373a8d1a09adc54cbd6a36ea84a should address this. I've also updated the dependencies.

evandrocoan commented 6 years ago

Thanks! I just merged this locally and it is working fine now

image