Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node.js/io.js support? self is not defined #150

Closed
subtleGradient opened this issue Jan 30, 2015 · 1 comment
Closed

node.js/io.js support? self is not defined #150

subtleGradient opened this issue Jan 30, 2015 · 1 comment

Comments

@subtleGradient
Copy link
Contributor

require('coffee-script/register');
Engine = require('./src/Engine.coffee');
/Users/aylott/src/gss:engine/src/Engine.coffee:704
  if (!self.window && self.onmessage !== void 0) {
       ^
ReferenceError: self is not defined
@Inviz
Copy link
Contributor

Inviz commented Jan 30, 2015

Hey Thomas. Thanks for trying. can't stress how excited I am.

Okay, I fixed the node issues at 2.1.x branch:
require('coffee-script/register');

    Engine = require('./engine/src/Engine.coffee');

    engine = new Engine({
        b: 2
    })

    engine.solve(['==', ['get', 'a'], ['+', ['get', 'b'], 1]], 'my-tracked-constraints')
    console.log(engine.values) // {b: 2, a: 3}

    engine.solve({b: 5}) // change external value
    console.log(engine.values) // {b: 5, a: 6}

    engine.solve({b: null}) //remove external value
    console.log(engine.values) // {a: 0, b: -1}

    engine.remove('my-tracked-constraints')
    console.log(engine.values) // {}

@Inviz Inviz closed this as completed Jan 31, 2015
Inviz pushed a commit that referenced this issue Feb 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants