Browse Source

init

tags/v0.9.1
3136352472 5 years ago
parent
commit
cecda81a2c
  1. 2
      govue/axios.js
  2. 32
      govue/promise.js
  3. 6
      jsruntime/runtime.go
  4. 8
      main.go

2
govue/axios.js

@ -571,7 +571,6 @@ return /******/ (function(modules) { // webpackBootstrap
// For node use HTTP adapter // For node use HTTP adapter
adapter = __webpack_require__(8); adapter = __webpack_require__(8);
} }
console.log("adapter",adapter);
return adapter; return adapter;
} }
@ -668,7 +667,6 @@ return /******/ (function(modules) { // webpackBootstrap
/* 8 */ /* 8 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
console.log("Axios")
'use strict'; 'use strict';
var utils = __webpack_require__(2); var utils = __webpack_require__(2);

32
govue/promise.js

@ -529,7 +529,7 @@ var Enumerator = function () {
} else if (typeof _then !== 'function') { } else if (typeof _then !== 'function') {
this._remaining--; this._remaining--;
this._result[i] = entry; this._result[i] = entry;
} else if (c === Promise$1) {
} else if (c === Promise$2) {
var promise = new c(noop); var promise = new c(noop);
handleMaybeThenable(promise, entry, _then); handleMaybeThenable(promise, entry, _then);
this._willSettleAt(promise, i); this._willSettleAt(promise, i);
@ -863,7 +863,7 @@ function needsNew() {
@constructor @constructor
*/ */
var Promise$1 = function () {
var Promise$2 = function () {
function Promise(resolver) { function Promise(resolver) {
this[PROMISE_ID] = nextId(); this[PROMISE_ID] = nextId();
this._result = this._state = undefined; this._result = this._state = undefined;
@ -1127,14 +1127,14 @@ var Promise$1 = function () {
return Promise; return Promise;
}(); }();
Promise$1.prototype.then = then;
Promise$1.all = all;
Promise$1.race = race;
Promise$1.resolve = resolve$1;
Promise$1.reject = reject$1;
Promise$1._setScheduler = setScheduler;
Promise$1._setAsap = setAsap;
Promise$1._asap = asap;
Promise$2.prototype.then = then;
Promise$2.all = all;
Promise$2.race = race;
Promise$2.resolve = resolve$1;
Promise$2.reject = reject$1;
Promise$2._setScheduler = setScheduler;
Promise$2._setAsap = setAsap;
Promise$2._asap = asap;
/*global self*/ /*global self*/
function polyfill() { function polyfill() {
@ -1167,17 +1167,19 @@ function polyfill() {
} }
} }
local.Promise = Promise$1;
local.Promise = Promise$2;
} }
// Strange compat.. // Strange compat..
Promise$1.polyfill = polyfill;
Promise$1.Promise = Promise$1;
Promise$2.polyfill = polyfill;
Promise$2.Promise = Promise$2;
return Promise$1;
Promise$2.polyfill();
return Promise$2;
}))); })));
//# sourceMappingURL=es6-promise.map
//# sourceMappingURL=es6-promise.auto.map

6
jsruntime/runtime.go

@ -78,9 +78,9 @@ func (jr *JsRuntime) setAjax() {
url := call.Argument(1) url := call.Argument(1)
data := call.Argument(3) data := call.Argument(3)
res, err := hskhttpdo.HttpDo{ res, err := hskhttpdo.HttpDo{
Url: url.ToString().String(),
Raw: []byte(data.ToString().String()),
}.Request(m.ToString().String())
Url: url.String(),
Raw: []byte(data.String()),
}.Request(m.String())
r := map[string]string{ r := map[string]string{
"code": "200", "code": "200",

8
main.go

@ -28,10 +28,10 @@ func main() {
Variable: "init", Variable: "init",
FileName: filepath.Join("..", "govue", "init.js"), FileName: filepath.Join("..", "govue", "init.js"),
}, },
jsruntime.Rely{
Variable: "Promise",
FileName: filepath.Join("..", "govue", "promise.js"),
},
//jsruntime.Rely{
// Variable: "Promise",
// FileName: filepath.Join("..", "govue", "promise.js"),
//},
jsruntime.Rely{ jsruntime.Rely{
Variable: "axios", Variable: "axios",
FileName: filepath.Join("..", "govue", "axios.js"), FileName: filepath.Join("..", "govue", "axios.js"),

Loading…
Cancel
Save