Equality operator not working as expected #66

Closed
goodwithgit opened this Issue Aug 30, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@goodwithgit

I have an object defined thus:

define Value {
    id : null,
    v : null,
    constructor : function (id, value) {
        this.id = id;
        this.v = value;
     }
}

I'm asserting a fact like this:

s.assert(new Value("xyz", 27));

Then looking for it in a when clause like this:

v4 : Value v4.id =~ /xyz/ && v4.v == 27;

The == comparison fails to trigger the rule. The following does trigger the rule:

 v4 : Value v4.id =~ /xyz/ && v4.v >= 27 && v4.v <= 27;

I expected the == to work.

@goodwithgit

This comment has been minimized.

Show comment
Hide comment
@goodwithgit

goodwithgit Sep 1, 2013

I should also note that the following two do not trigger the rule:

 v4 : Value v4.id =~ /xyz/ && v4.v >= 27;

or

 v4 : Value v4.id =~ /xyz/ && v4.v <= 27;

Only when they appear together does the rule get triggered.

I should also note that the following two do not trigger the rule:

 v4 : Value v4.id =~ /xyz/ && v4.v >= 27;

or

 v4 : Value v4.id =~ /xyz/ && v4.v <= 27;

Only when they appear together does the rule get triggered.

doug-martin added a commit to doug-martin/nools that referenced this issue Sep 4, 2013

v0.1.10
* Added ability to `import` other nools files to create composible rules files [#58](noolsjs#58)
* When using `global` to require other files you can now require other files relative to the nools file
* Added uglify-js as a dependency instead of devDependency #71
* Fixed issue #61 where transpile would not properly escape `"` character.
* Fixed issue #66 and #67 where regular expression matching was too greedy.
* Fixed issue #62 where constraints with a `"` character would produce invalid javascript when `transpiling`.
* Fixed issue #69 where rules names with a `'` character in a rule would produce invalid javascript when `transpiling`.

@doug-martin doug-martin referenced this issue Sep 4, 2013

Merged

v0.1.10 #63

@doug-martin

This comment has been minimized.

Show comment
Hide comment
@doug-martin

doug-martin Sep 4, 2013

Contributor

This should be fixed in the v0.1.10 as I could not reproduce after fixing #67.

Contributor

doug-martin commented Sep 4, 2013

This should be fixed in the v0.1.10 as I could not reproduce after fixing #67.

@doug-martin doug-martin closed this Sep 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment