Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

This one’s a head-scratcher! So function declarations inside an object literal {} are auto-bound to it, but it’s not clear how does it know to do that - even if you do

var f2 = function() {};
f2 = method(undefined, f2);
var f3 = function() {}
var obj = {
	func: function() {},
	func2: f2,
	func3: f3,
}
trace("f1", method_get_self(obj.func));
trace("f2", method_get_self(obj.func2));
trace("f3", method_get_self(obj.func3));

that does not change ownership of func2/func3.