Skip to content

Instantly share code, notes, and snippets.

@rolaveric
Last active August 29, 2015 13:57
Show Gist options
  • Save rolaveric/9407725 to your computer and use it in GitHub Desktop.
Save rolaveric/9407725 to your computer and use it in GitHub Desktop.
The extract from gopherjsResult.js which doesn't include the builtin library code.
// Lines 8-13
var go$global;
if (typeof window !== "undefined") {
go$global = window;
} else if (typeof GLOBAL !== "undefined") {
go$global = GLOBAL;
}
// Lines 1425-1461
go$packages["github.com/rolaveric/gopherjs/pet"] = (function() {
var go$pkg = {}, Pet, New;
Pet = go$pkg.Pet = go$newType(0, "Struct", "pet.Pet", "Pet", "github.com/rolaveric/gopherjs/pet", function(name_) {
this.go$val = this;
this.name = name_ !== undefined ? name_ : "";
});
Pet.Ptr.prototype.Name = function() {
var p;
p = this;
return p.name;
};
Pet.prototype.Name = function() { return this.go$val.Name(); };
Pet.Ptr.prototype.SetName = function(newName) {
var p;
p = this;
p.name = newName;
};
Pet.prototype.SetName = function(newName) { return this.go$val.SetName(newName); };
New = go$pkg.New = function(name) {
return new Pet.Ptr(name);
};
go$pkg.init = function() {
(go$ptrType(Pet)).methods = [["Name", "", [], [Go$String], false, -1], ["SetName", "", [Go$String], [], false, -1]];
Pet.init([["name", "name", "github.com/rolaveric/gopherjs/pet", Go$String, ""]]);
}
return go$pkg;
})();
go$packages["C:\GoCode\src\github.com\rolaveric\gopherjs"] = (function() {
var go$pkg = {}, js = go$packages["github.com/gopherjs/gopherjs/js"], pet = go$packages["github.com/rolaveric/gopherjs/pet"], main;
main = go$pkg.main = function() {
var _map, _key;
go$global.pet = go$externalize((_map = new Go$Map(), _key = "New", _map[_key] = { k: _key, v: new (go$funcType([Go$String], [(go$ptrType(pet.Pet))], false))(pet.New) }, _map), (go$mapType(Go$String, go$emptyInterface)));
};
go$pkg.init = function() {
}
return go$pkg;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment