Skip to content

Commit

Permalink
Improved Future.complete
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Nov 18, 2016
1 parent 307d2b4 commit 181424d
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,7 +1,7 @@
{
"author": "Ma Bingyao <andot@hprose.com>",
"name": "hprose-html5",
"version": "2.0.26",
"version": "2.0.27",
"description": "Hprose is a High Performance Remote Object Service Engine.",
"keywords": [
"hprose",
Expand Down
6 changes: 3 additions & 3 deletions dist/hprose-html5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/hprose-html5.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/hprose-html5.src.js
@@ -1,4 +1,4 @@
// Hprose for HTML5 v2.0.26
// Hprose for HTML5 v2.0.27
// Copyright (c) 2008-2016 http://hprose.com
// Hprose is freely distributable under the MIT license.
// For all details and documentation:
Expand Down Expand Up @@ -1772,7 +1772,8 @@ hprose.global = (
);
} },
complete: { value: function(oncomplete) {
return this.then(oncomplete, oncomplete);
oncomplete = oncomplete || function(v) { return v; };
return this.then(oncomplete, oncomplete);
} },
always: { value: function(oncomplete) {
this.done(oncomplete, oncomplete);
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "hprose-html5",
"filename": "hprose-html5.js",
"version": "2.0.26",
"version": "2.0.27",
"description": "Hprose is a High Performance Remote Object Service Engine.",
"homepage": "https://github.com/andot/hprose",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/CopyRight.js
@@ -1,4 +1,4 @@
// Hprose for HTML5 v2.0.26
// Hprose for HTML5 v2.0.27
// Copyright (c) 2008-2016 http://hprose.com
// Hprose is freely distributable under the MIT license.
// For all details and documentation:
Expand Down
3 changes: 2 additions & 1 deletion src/Future.js
Expand Up @@ -687,7 +687,8 @@
);
} },
complete: { value: function(oncomplete) {
return this.then(oncomplete, oncomplete);
oncomplete = oncomplete || function(v) { return v; };
return this.then(oncomplete, oncomplete);
} },
always: { value: function(oncomplete) {
this.done(oncomplete, oncomplete);
Expand Down

0 comments on commit 181424d

Please sign in to comment.