1
0
Fork 0
easejs/test
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
..
Interface Copyright year update 2011-12-23 00:09:11 -05:00
MemberBuilder Added support for static proxy methods 2012-05-03 14:13:47 -04:00
MemberBuilderValidator Added `proxy' keyword support 2012-05-03 09:49:22 -04:00
perf Copyright year update 2011-12-23 00:09:11 -05:00
FallbackMemberBuilderTest.js Copyright year update 2011-12-23 00:09:11 -05:00
FallbackVisibilityObjectFactoryTest.js Converted a number of test cases to new XUnit-style format 2012-05-03 21:47:43 -04:00
Makefile Added GNU GPL v3+ license header and copyright notice to all scripts and Makefiles 2012-05-11 19:11:12 -04:00
MethodWrapperFactoryTest.js Converted a number of test cases to new XUnit-style format 2012-05-03 21:47:43 -04:00
MethodWrappersTest.js Converted a number of test cases to new XUnit-style format 2012-05-03 21:47:43 -04:00
VersionTest.js Resolved version test error caused by verset commit 2012-04-06 00:21:05 -04:00
VisibilityObjectFactoryFactoryTest.js Converted a number of test cases to new XUnit-style format 2012-05-03 21:47:43 -04:00
VisibilityObjectFactoryTest.js Converted a number of test cases to new XUnit-style format 2012-05-03 21:47:43 -04:00
common.js Copyright year update 2011-12-23 00:09:11 -05:00
inc-testcase.js Moved setup method for XUnit style testing into tryTest() function to properly handle exceptions 2012-05-03 21:47:36 -04:00
runner.js Copyright year update 2011-12-23 00:09:11 -05:00
test-class-abstract.js Added `proxy' keyword support 2012-05-03 09:49:22 -04:00
test-class-constructor.js [Fix #37] constructor property now properly set on instances 2012-01-19 23:21:04 -05:00
test-class-extend.js Copyright year update 2011-12-23 00:09:11 -05:00
test-class-gettersetter.js 'this' now properly binds to the private member object of the instance for getters/setters 2013-01-19 22:38:35 -05:00
test-class-implement.js Copyright year update 2011-12-23 00:09:11 -05:00
test-class-name.js Copyright year update 2011-12-23 00:09:11 -05:00
test-class-parent.js Copyright year update 2011-12-23 00:09:11 -05:00
test-class-visibility.js Copyright year update 2011-12-23 00:09:11 -05:00
test-class.js Copyright year update 2011-12-23 00:09:11 -05:00
test-class_builder-const.js Added `proxy' keyword support 2012-05-03 09:49:22 -04:00
test-class_builder-final.js Copyright year update 2011-12-23 00:09:11 -05:00
test-class_builder-member-restrictions.js Added constructor property to reserved members list 2012-01-17 23:36:01 -05:00
test-class_builder-static.js Added `proxy' keyword support 2012-05-03 09:49:22 -04:00
test-class_builder-visibility.js Added `proxy' keyword support 2012-05-03 09:49:22 -04:00
test-combine-pre-es5.js Copyright year update 2011-12-23 00:09:11 -05:00
test-combine.js Copyright year update 2011-12-23 00:09:11 -05:00
test-index.js Created version module to provide additional version information 2011-12-23 18:31:11 -05:00
test-interface-name.js Copyright year update 2011-12-23 00:09:11 -05:00
test-prop_parser-parse-keywords.js Copyright year update 2011-12-23 00:09:11 -05:00
test-rmtrail Copyright year update 2011-12-23 00:09:11 -05:00
test-util-abstract.js Copyright year update 2011-12-23 00:09:11 -05:00
test-util-clone.js Copyright year update 2011-12-23 00:09:11 -05:00
test-util-copy.js Copyright year update 2011-12-23 00:09:11 -05:00
test-util-define-secure-prop.js Copyright year update 2011-12-23 00:09:11 -05:00
test-util-get-property-descriptor.js Copyright year update 2011-12-23 00:09:11 -05:00
test-util-prop-parse-keywords.js Copyright year update 2011-12-23 00:09:11 -05:00
test-util-prop-parse.js Corrected a bug whereby getters were being inadvertently invoked by util.propParse() 2013-01-19 22:38:31 -05:00
test-warn-exception.js Copyright year update 2011-12-23 00:09:11 -05:00
test-warn-handlers.js Copyright year update 2011-12-23 00:09:11 -05:00
test-warn-impl.js Copyright year update 2011-12-23 00:09:11 -05:00