1
0
Fork 0
easejs/lib
Mike Gerwitz b4fe08292f
'this' now properly binds to the private member object of the instance for getters/setters
Getters/setters did not get much attention during the initial development of
ease.js, simply because there was such a strong focus on pre-ES5
compatibility---ease.js was created for a project that strongly required it.
Given that, getters/setters were not used, since those are ES5 features. As
such, I find that two things have happened:

  1. There was little incentive to provide a proper implementation; even though
     I noticed the issues during the initial development, they were left
     unresolved and were then forgotten about as the project lay dormant for a
     while.
  2. The project was dormant because it was working as intended (sure, there
     are still things on the TODO-list feature-wise). Since getters/setters were
     unused in the project for which ease.js was created, the bug was never
     found and so never addressed.

That said, I now am using getters/setters in a project with ease.js and noticed
a very odd bug that could not be explained by that project's implementation.
Sure enough, it was an ease.js issue and this commit resolves it.

Now, there is more to be said about this commit. Mainly, it should be noted that
MemberBuilder.buildGetterSetter, when compared with its method counterpart
(buildMethod) is incomplete---it does not properly address overrides, the
abstract keyword, proxies or the possibility of method hiding. This is certainly
something that I will get to, but I want to get this fix out as soon as I can.
Since overriding ES5 getters/setters (rather than explicit methods) is more
likely to be a rarity, and since a partial fix is better than no fix, this will
likely be tagged immediately and a further fix will follow in the (hopefully
near) future.

(This is an interesting example of how glaring bugs manage to slip through the
cracks, even when the developer is initially aware of them.)
2013-01-19 22:38:35 -05:00
..
ClassBuilder.js 'this' now properly binds to the private member object of the instance for getters/setters 2013-01-19 22:38:35 -05:00
FallbackMemberBuilder.js Copyright year update 2011-12-23 00:09:11 -05:00
FallbackVisibilityObjectFactory.js Copyright year update 2011-12-23 00:09:11 -05:00
MemberBuilder.js 'this' now properly binds to the private member object of the instance for getters/setters 2013-01-19 22:38:35 -05:00
MemberBuilderValidator.js 'this' now properly binds to the private member object of the instance for getters/setters 2013-01-19 22:38:35 -05:00
MethodWrapperFactory.js Added support for static proxy methods 2012-05-03 14:13:47 -04:00
MethodWrappers.js Added support for static proxy methods 2012-05-03 14:13:47 -04:00
VisibilityObjectFactory.js Copyright year update 2011-12-23 00:09:11 -05:00
VisibilityObjectFactoryFactory.js Copyright year update 2011-12-23 00:09:11 -05:00
class.js Added `proxy' keyword support 2012-05-03 09:49:22 -04:00
class_abstract.js Copyright year update 2011-12-23 00:09:11 -05:00
class_final.js Copyright year update 2011-12-23 00:09:11 -05:00
interface.js Added `proxy' keyword support 2012-05-03 09:49:22 -04:00
prop_parser.js Added `proxy' keyword support 2012-05-03 09:49:22 -04:00
util.js Corrected a bug whereby getters were being inadvertently invoked by util.propParse() 2013-01-19 22:38:31 -05:00
version.js Set version to 0.2.0-dev 2012-03-05 22:55:14 -05:00
warn.js Corrected warning console output invocation 2013-01-19 22:38:26 -05:00