1
0
Fork 0
Commit Graph

313 Commits (9fe26e7582cfe402abffc2173f32507792b965ad)

Author SHA1 Message Date
Mike Gerwitz 9fe26e7582 [#25] Moved MemberBuilderValidator/MethodTest's helper functions into caseSetUp() 2011-10-22 16:49:51 -04:00
Mike Gerwitz 2da2247c86 [#25] Added successful test to MemberBuilderValidator's method tests to ensure successful functionality is also tested 2011-10-22 16:47:09 -04:00
Mike Gerwitz 8ebcc3f1b3 [#25] Removed duplicate code from MemberBuilderValidator method test 2011-10-22 16:37:58 -04:00
Mike Gerwitz a5e2a507f2 [#25] Throwing error instead of method hiding; will implement in future 2011-10-22 13:57:17 -04:00
Mike Gerwitz 6e7e031ff9 [#25] [#25] Re-added accidently removed portion of test 2011-10-22 11:06:03 -04:00
Mike Gerwitz f9b951ddb2 [#25] [#25] Began moving MemberBuilder validation rules into MemberBuilderValidator (moved method rules) 2011-10-22 01:00:45 -04:00
Mike Gerwitz e6830b741f [#25] Now using keywords to compare visibility levels in validations to eliminiate fallback inconsistencies
Ironic, considering the current refactoring (not yet committed) of MemberBuilder to split validation logic into MemberBuilderValidator was partially to be able to easily override the fallback logic. It's a useful refactoring nonetheless, but it could have waited.
2011-10-22 00:32:59 -04:00
Mike Gerwitz 4d2d95a99f [#25] Added test case error output for browser 2011-10-21 16:04:27 -04:00
Mike Gerwitz aeff796332 [#25] [#25] Added member builder tests for private and protected members 2011-10-21 16:04:24 -04:00
Mike Gerwitz ea972bdffc [#25] Added ability to manually increment assertion count for custom assertions 2011-10-21 12:10:53 -04:00
Mike Gerwitz 9ea60a18b0 [#25] Added assertion count to testcase output 2011-10-21 12:10:53 -04:00
Mike Gerwitz f7700f93e5 [#25] Refactored MemberBuilder/VisibilityTest basic tests into reusable functions for upcoming tests in other access levels 2011-10-21 12:10:49 -04:00
Mike Gerwitz bb9eb16fd3 [#25] Began adding MemberBuilder/VisibilityTest to test MemberBuilder directly
As mentioned in a prior commit blog-like entry, many of the tests evolved into more of an integration or system-level type of test. Let's get away from that.
2011-10-21 12:09:00 -04:00
Mike Gerwitz 474d8f307d [#25] Added caseSetUp() for test cases 2011-10-21 10:57:34 -04:00
Mike Gerwitz c1207eb3d5 Moved MemberBuilder-MethodTest into MemberBuilder subdir
- Altered combine script to support subdirs (note that the dir names aren't included in the combined file)
2011-10-20 23:40:30 -04:00
Mike Gerwitz 8c0058698a Removed accidental commit of console.log() in test-combine.js 2011-10-14 22:36:10 -04:00
Mike Gerwitz 024f3b778c Began adding FallbackMemberBuilder test case
This is the first test case to use the new basic xUnit-style system. This
system is likely to evolve over time. Right now it's purely for
setUp, organizational and output purposes.
2011-10-14 22:05:22 -04:00
Mike Gerwitz c10fc5818a Added very basic formatted output and failure tolerance for test case
The one year anniversary of the beginning of the ease.js project is quickly
approaching. I find myself to be not quite where I had expected many months ago,
but find that the project has evolved so much further than I had event
originally anticipated. My main motivation behind the project continues to be
making my life at work easier, while providing an excellent library that others
can hopefully benefit from. If anything, it's a fascinating experiment and
clever hack around JavaScript.

Now I find myself with a newborn child (nearly four weeks old), who demands my
constant attention (and indeed, it is difficult to find the desire to put my
attention elsewhere). Still - I am a hacker. Software is my passion. So the
project must move forward.

I also find myself unwilling to create a blog for ease.js. I feel it's
inappropriate for a project that's in its (relative) infancy and does not have
much popularity (it has never been announced to anyone). As such, I feel that
commit messages will serve my purpose as useful journal entries regarding the
status of the project. They will also be interesting easter eggs for those who
would wish to seek them out for additional perspective on the project. (Granted,
one could easy script the discovery of such entries by examining the absurd
length of the commit message...perhaps the git log manpages would be useful).

So. Let's get back to the project.

ease.js is currently going through a strong refactoring in order to address
design issues that have begun to creep up as the project grew. The initial
design was a very simple one - a "series of modules", as it was originally
described in a CommonJS sense, that would provide features of a classical
Object-Oriented system. It would seem ironic that, having a focus on
classical Object-Oriented development, one would avoid developing the project in
such a paradigm. Instead, I wished to keep the design simple (because the
project seemed simple), more natural to JS developers (prototypal) and
performant (object literals do not have the overhead of instantiation). Well,
unfortunately, the project scope has increased drastically due to the success of
the implementation (and my playfulness), the chosen paradigm has become awkward
in itself and the performance benefit is indeed a micro-optimization when
compared with the performance of both the rest of the system and the system that
will implement ease.js as a framework.

You can only put off refactoring for so long before the system begins to trip
over itself and stop being a pleasure to work with. In fact, it's a slap in the
face. You develop this intricate and beautiful system (speaking collectively and
generally, of course) and it begins to feel tainted. In order to prevent it from
developing into a ball of mud - a truly unmaintainable mess - the act of
refactoring is inevitable, especially if we want to ensure that the project
survives and is actively developed for any length of time.

In this case, the glaring problem is that each of the modules are terribly,
tightly coupled. This reduces the flexibility of the system and forces us to
resort to a system riddled with conditionals. This becomes increasingly apparent
when we need to provide slightly different implementations between environments
(e.g. ES5/pre-ES5, production/development, etc and every combination).
Therefore, we need to decouple the modules in order to take advantage of
composition in order to provide more flexible feature sets depending on
environment.

What does this mean?

We need to move from object literals for the modules to prototypes (class-like,
but remember that ease.js exists because JS does not have "classes"). A number
of other prototypes can be extracted from the existing modules and abstracted to
the point where they can be appropriately injected where necessary. Rather than
using conditions for features such as fallbacks, we can encapsulate the entire
system in a facade that contains the features relevant to that particular
environment. This will also have the consequence that we can once again test
individual units rather than systems.

At the point of this commit (this entry was written before any work was done),
the major hurdle is refactoring the test cases so that they do not depend on
fallback logic and instead simply test specific units and skip the test if the
unit (the prototype) is not supported by the environment (e.g. proxies in a
pre-ES5 environment). This will allow us to finish refactoring the fallback and
environment-specific logic. It will also allow us to cleanly specify a fallback
implementation (through composition) in an ES5 environment while keeping ES5
detection mechanisms separate.

The remaining refactorings will likely be progressive. This all stemmed out of
the desire to add the method hiding feature, whose implementation varies
depending on environment. I want to get back to developing that feature so I can
get the first release (v0.1.0) out. Refactoring can continue after that point.
This project needs a version number so it can be used reliably.
2011-10-12 18:53:52 -04:00
Mike Gerwitz f21f35019e Renamed test case to MemberBuilder-MethodTest.js (#25) 2011-09-02 23:31:57 -04:00
Mike Gerwitz b0cec62c98 test-member_builder-method freed from unnecessary dependencies for testing (#25) 2011-09-02 23:25:13 -04:00
Mike Gerwitz 1af7617a83 Moved instance binding test to MethodWrappersTest (#25)
- Ah; see how much nicer this is?
2011-09-02 23:07:42 -04:00
Mike Gerwitz 5937f7b0be Transferred method __super() invocation test to MethodWrappersTest (#25) 2011-09-02 22:55:10 -04:00
Mike Gerwitz 40d555ee3f Begin moving method wrapper tests into MethodWrappersTest (#25) 2011-09-02 22:47:35 -04:00
Mike Gerwitz bc636637cc Refactored new and override method wrappers into separate prototypes
- Note that, since we're mid-refactor, this is a bit of a mess
2011-08-31 00:24:19 -04:00
Mike Gerwitz ce1370e025 Now passing getInst() directly into MethodwrapperFactory factory function, like good 'ol times
- I seem to have forgotten that this is necessary due to the static implementation
2011-08-31 00:05:07 -04:00
Mike Gerwitz ba251d5a21 Ensuring combined tests run last 2011-08-29 23:17:44 -04:00
Mike Gerwitz 3c5362db0a Added MethodWrapperFactory prototype
- Not yet used
2011-08-28 17:36:27 -04:00
Mike Gerwitz 758162ad0f Began refactoring member_builder module into MemberBuilder prototype (#25) 2011-08-14 18:47:48 -04:00
Mike Gerwitz fd95f38c87 Integrated VisibilityObjectFactory and removed old propobj (#25)
- Note that the excessive gluing is temporary
2011-08-13 23:58:08 -04:00
Mike Gerwitz f3352e6d74 Added VisibilityObjectFactoryFactory (#25)
- This may be temporary, depending on the ultimate implementation. This is intended to ease into the refactoring.
2011-08-13 23:00:03 -04:00
Mike Gerwitz 567c9f59a0 Implemented FallbackVisibilityObjectFactory (#25) 2011-08-13 22:42:33 -04:00
Mike Gerwitz cd1f8921de Prototype tests now have 'Test' suffix, rather than 'test-' prefix (#25) 2011-08-11 23:25:20 -04:00
Mike Gerwitz 79652a1120 Moved non-fallback visibility object into VisibilityObjectFactory (system does not yet use it) (#25) 2011-08-11 23:11:37 -04:00
Mike Gerwitz 7a579ab2aa Initial refactoring of class_builder module into ClassBuilder ctor (#25) 2011-08-09 17:27:26 -04:00
Mike Gerwitz a401c31996 Can no longer override non-virtual methods (#19) 2011-08-04 00:44:20 -04:00
Mike Gerwitz 2569dacf15 Override keyword is now required to override a virtual method (#19) 2011-08-04 00:32:10 -04:00
Mike Gerwitz bd4e18acc6 Implicit method hiding warning now applies to virtual methods as well as non-virtual (#19) 2011-08-03 22:40:55 -04:00
Mike Gerwitz 5f95fecda6 More appropriately named method hiding test (#19) 2011-08-03 22:10:46 -04:00
Mike Gerwitz db18a61d30 [#19] Began implementing method hiding (added warning for implicit hiding) 2011-07-06 19:35:00 -04:00
Mike Gerwitz b74e03704b Corrected member builder method test testCannotOverridePropertyWithMethod 2011-07-06 18:49:01 -04:00
Mike Gerwitz 65d988b1c6 Set stack trace limit to 20 frames for tests 2011-07-06 18:06:22 -04:00
Mike Gerwitz 1b1a4b60d5 Altered warning display and stack trace 2011-07-06 17:55:40 -04:00
Mike Gerwitz 81fa2ae424 Merge branch 'master' into 'virtual/master'
- Resolved conflicts
2011-06-30 23:00:13 -04:00
Mike Gerwitz adb7e088b7 [#19] Cannot declare virtual static methods 2011-06-09 22:22:14 -04:00
Mike Gerwitz 8b33471e42 Corrected non-virtual override test 2011-06-09 22:22:11 -04:00
Mike Gerwitz 08dc2559b4 [#19] Cannot declare virtual properties 2011-06-09 19:46:13 -04:00
Mike Gerwitz 7f24d094ba [#19] Re-added FinalClass tests (we still want those ;)) 2011-06-08 01:28:45 -04:00
Mike Gerwitz 4fea62a8ed [#19] Removed 'final' keyword and all associated logic
- Kept FinalClass'
2011-06-08 01:26:04 -04:00
Mike Gerwitz 8b83e85c43 [#19] Implemented 'virtual' keyword
- Baby steps. 'override' keyword is not yet necessary.
- Final not yet removed
2011-06-08 01:11:53 -04:00
Mike Gerwitz 557dcf6904 Fixed static bug and removed late static binding
- Late static binding will be revisited in the future
2011-05-31 22:29:07 -04:00