srikumarks / FD.js

Finite domain constraint programming library in JS
62 stars 6 forks source link

Error in Internet Explorer 8 #1

Closed hrigu closed 10 years ago

hrigu commented 11 years ago

IE8 has an error when using fd.js. The message is: Expected identifier, string or number fds.js Code: 0 line: 1079 char: 33 URI: .../fd.js

The problematic part of code is here

//line1079
state = S.__branch_state = {
  var: v,  //<- here. I think var is a keyword
  dom: dom,
  i: 0,
  val: dom[0][0]
};

I've fixed it by changing the key 'var' to 'varr'

Christian

srikumarks commented 11 years ago

Hi - you may be using an older version of fd.js? The current version does not have this code (or any __branch_state) anywhere. I sort of vaguely remember that code, but I've since changed the implementation of branching. Do let me know if you're still facing problems after updating to the current.

hrigu commented 11 years ago

yes indeed, we used an old version from https://code.google.com/p/fdcp/

Sorry!

hrigu commented 11 years ago

Hi, The current version doesn't work on ie8, either:

The error message is "Expected identifier" on line 523 See https://github.com/srikumarks/FD.js/blob/master/fd.js#L523


    // Create a "constant". We have no optimizing support for
    // constants at the moment and just treat it as a temp FDVar
    // whose domain is of size = 1.
    Space.prototype.const = function (val) {   // line 523 <== Here
        if (val < 0 || val > FD_SUP) {
            throw "FD.space.const: Value out of valid range";
        }

        return this.temp([[val, val]]);
    };

Christian