Ready for testing: vibe.d 0.7.26-alpha.3
Brad Anderson via Digitalmars-d
digitalmars-d at puremagic.com
Tue Oct 13 23:23:36 PDT 2015
On Tuesday, 13 October 2015 at 07:38:33 UTC, Sönke Ludwig wrote:
> Despite it's name, this release should be considered a beta
> release. PR #1268[1] will potentially still make it in, but
> otherwise only bug fixing will happen at this point. As with
> the previous versions, the final release will happen at the
> same time as DMD 2.069.0. Please use the chance to test for any
> remaining issues (simply run `dub upgrade --prerelease` on your
> project(s)).
>
> Changes in this release:
> https://github.com/rejectedsoftware/vibe.d/blob/master/CHANGELOG.md
>
> [1]: https://github.com/rejectedsoftware/vibe.d/pull/1268
Trying out the new JS interface generation on a little toy
project I'm getting:
this.vote = function(winner, loser, on_error) {
var url = "http://127.0.0.1:8008/vote";
var postbody = {
"winner": toRestString(winner),
"loser": toRestString(loser),
};
var xhr = new XMLHttpRequest();
xhr.open('PUT', url, true);
xhr.onload = function () { if (this.status >= 400) { if
(on_error) on_error(JSON.parse(this.responseText)); else
console.log(this.responseText); } else
on_result(JSON.parse(this.responseText)); };
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify(postbody));
}
The on_result was never defined before use.
The interface method looks like this:
@property void vote(int winner, int loser);
Really cool feature though.
More information about the Digitalmars-d
mailing list