You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2017/12/22 06:23:03 UTC

[GitHub] jacobrosenthal opened a new pull request #120: gopherjs test

jacobrosenthal opened a new pull request #120: gopherjs test
URL: https://github.com/apache/mynewt-newt/pull/120
 
 
   
   Theres nothing wrong with my [node-newtmgr](https://github.com/jacobrosenthal/node-newtmgr), in fact I think its a pretty clean implementation. And there hasnt been much work done since so I think its still in sync with official. However it could get out of sync, which sucks, so I wanted to checkout [gopherjs](https://github.com/gopherjs/gopherjs) as a way to officially port newtmgr
   
   It 'compiles' golang into js
   
   I had to make some changes:
   
   kill cmdrunner because its complicated
   kill coreload because it wants cmdrunner
   
   and remake util locally since it has the kitchen sink in it and we only need the error function
   
   ```
   $ go get -u github.com/gopherjs/gopherjs
   ...
   $ cd $GOPATH/src/mynewt.apache.org/newt/newtmgr
   $ gopherjs build main.go 
   $ node 
   > require('./main.js');
   warning: system calls not available, see https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md
   {}
   > var main = global.reset;
   undefined
   > var reset = main.New(); 
   undefined
   > var something = reset.EncodeWriteRequest()
   undefined
   > console.log(something)
   [ { Op: 2,
       Flags: 0,
       Len: 2,
       Group: 0,
       Seq: 0,
       Id: 5,
       Data: Uint8Array [ 123, 125 ] },
     null ]
   undefined
   > console.log(something[0])
   { Op: 2,
     Flags: 0,
     Len: 2,
     Group: 0,
     Seq: 0,
     Id: 5,
     Data: Uint8Array [ 123, 125 ] }
   undefined
   ```
   
   Not sure i want to do more than that, but kind of cool. Cant make issues so, just making as a PR to document. I expect you to chuckle and close this.  Shrug

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services