Problem with nodejs amber-examples while using current amber master.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with nodejs amber-examples while using current amber master.

Tom Rake
I thought I would attempt to update the amber-examples so my branch  https://github.com/tomrake/amber-examples/tree/update-examples.

I took amber-examples and pulled vendor/amber to the current master.

I fixed most of web examples and then proceeded to try the nodejs examples in every case all the web apps needed a reference to smalltalk to work so I used the loadAmber ready() to provide that as amber.js clearly provides that:

ready: function(smalltalk) {

The problems are now the nodjs examples and I start with hello being the simpliest

grunt amberc:hello
./hello

I received this error:

C:\Users\twr\My code\amber-examples\nodejs\hello\Program.js:18485
})(global_smalltalk,global_nil,global__st);smalltalk.Hello._main()
                                           ^
ReferenceError: smalltalk is not defined
    at Object.<anonymous> (C:\Users\twr\My code\amber-examples\nodejs\hello\Program.js:18485:44)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

I am guessing I need to provide the smalltalk value for the nodejs cases.

 

 

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with nodejs amber-examples while using current amber master.

Tom Rake
I found and fixed the problem. amberc.js  line #610 where a main class is added to generated .js file. That line should be:

fileStream.write('global_smalltalk.' + defaults.main + '._main()');

With this change the nodejs examples compile and run or at least hello and trivialserver which I have checked.

I will file a bug and pull request.



On Friday, August 23, 2013 1:54:17 PM UTC-4, Thomas Rake wrote:
I thought I would attempt to update the amber-examples so my branch  https://github.com/tomrake/amber-examples/tree/update-examples.

I took amber-examples and pulled vendor/amber to the current master.

I fixed most of web examples and then proceeded to try the nodejs examples in every case all the web apps needed a reference to smalltalk to work so I used the loadAmber ready() to provide that as amber.js clearly provides that:

ready: function(smalltalk) {

The problems are now the nodjs examples and I start with hello being the simpliest

grunt amberc:hello
./hello

I received this error:

C:\Users\twr\My code\amber-examples\nodejs\hello\Program.js:18485
})(global_smalltalk,global_nil,global__st);smalltalk.Hello._main()
                                           ^
ReferenceError: smalltalk is not defined
    at Object.<anonymous> (C:\Users\twr\My code\amber-examples\nodejs\hello\Program.js:18485:44)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

I am guessing I need to provide the smalltalk value for the nodejs cases.

 

 

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.