1
0
Fork 0
Commit Graph

947 Commits (5047d895c010b930dabd842efa2e809e4c4658f5)

Author SHA1 Message Date
Mike Gerwitz 5047d895c0 Moved closure out of getMemberVisibility
This was defining a function on every call for no particular reason other
than being lazy, it seems.

Performance poopoo.
2014-03-15 21:16:26 -04:00
Mike Gerwitz 66cab74cc1 Initial trait virtual member proxy implementation
This has some flaws that should be addressed, but those will be detailed in
later commits; this works for now.
2014-03-15 21:16:26 -04:00
Mike Gerwitz 3c7cd0e57a Added virtual members to class metadata
There does not seem to be tests for any of the metadata at present; they are
implicitly tested through various implementations that make use of them.
This will also be the case here ("will"---in coming commits), but needs to
change.

The upcoming reflection implementation would be an excellent time to do so.
2014-03-15 21:16:26 -04:00
Mike Gerwitz a0a5c61631 Simplified ClassBuilder.buildMembers params
This cuts down on the excessive parameter length and opens up room for
additional metadata generation. Some slight foreshadowing here.
2014-03-15 21:16:26 -04:00
Mike Gerwitz b7a314753a Began implementing virtual trait methods
These require special treatment with proxying.
2014-03-15 21:16:26 -04:00
Mike Gerwitz 40e287bfc3 Warning no longer issued when overriding weak method appearing later in dfn obj 2014-03-15 21:16:26 -04:00
Mike Gerwitz 1b323ed80b Validation warnings now stored in state object
This will allow for additional processing before actually triggering the
warnings. For the sake of this commit, though, we just keep with existing
functionality.
2014-03-15 21:16:26 -04:00
Mike Gerwitz dac4b9b3a1 The `weak' keyword can now apply to overrides
Well, technically anything, but we're leaving that behavior as undefined for
now (the documentation will say the same thing).
2014-03-07 00:47:43 -05:00
Mike Gerwitz b04a8473b8 Implemented abstract traits
This is just an initial implementation, so there may be some quirks; there
are more tests to come.
2014-03-07 00:47:43 -05:00
Mike Gerwitz 987a2b88ec Classes can now access trait protected members
Slight oversight in the original commit.
2014-03-07 00:47:43 -05:00
Mike Gerwitz c10fe5e248 Proxy methods may now override abstract methods
The method for doing so is a kluge; see the test case for more info.
2014-03-07 00:47:43 -05:00
Mike Gerwitz 548c38503f Added support for weak abstract methods
This adds the `weak' keyword and permits abstract method definitions to
appear in the same definition object as the concrete implementation. This
should never be used with hand-written code---it is intended for code
generators (e.g. traits) that do not know if a concrete implementation will
be provided, and would waste cycles duplicating the property parsing that
ease.js will already be doing. It also allows for more concise code
generator code.
2014-03-07 00:47:43 -05:00
Mike Gerwitz 18ac37c871 Added support for `weak' keyword
Note that, even though it's permitted, the validator still needs to be
modified to permit useful cases. In particular, I need weak abstract and
strong concrete methods for use in traits.
2014-03-07 00:47:43 -05:00
Mike Gerwitz 00c76c69df Trait concrete class will now be lazily created on first use
This just saves some time and memory in the event that the trait is never
actually used, which may be the case in libraries or dynamically loaded
modules.
2014-03-07 00:47:43 -05:00
Mike Gerwitz 93eda3c14b Added tests proving traits' scopes are disjoint from classes' and each others'
This was the original motiviation behind, and is a beautiful consequence of,
the composition-based trait implementation (see
<https://savannah.gnu.org/task/index.php#comment3>).
2014-03-07 00:47:43 -05:00
Mike Gerwitz e44ac3190b Protected trait methods are now mixed in 2014-03-07 00:47:43 -05:00
Mike Gerwitz 3724b1bc0d Re-implemented mixin error for member name conflicts 2014-03-07 00:47:43 -05:00
Mike Gerwitz 71358eab59 Began implementing composition-based traits
As described in <https://savannah.gnu.org/task/index.php#comment3>.

The benefit of this approach over definition object merging is primarily
simplicitly---we're re-using much of the existing system. We may provide
more tight integration eventually for performance reasons (this is a
proof-of-concept), but this is an interesting start.

This also allows us to study and reason about traits by building off of
existing knowledge of composition; the documentation will make mention of
this to explain design considerations and issues of tight coupling
introduced by mixing in of traits.
2014-03-07 00:47:42 -05:00
Mike Gerwitz dfc83032d7 Basic, incomplete, but workable traits
Note the incomplete tests. These are very important, but the current state
at least demonstrates conceptually how this will work (and is even useful in
its current state, albeit dangerous and far from ready for production).
2014-03-07 00:47:42 -05:00
Mike Gerwitz 62035a0b4c Beginning of Trait and Class.use
This is a rough concept showing how traits will be used at definition time
by classes (note that this does not yet address how they will be ``mixed
in'' at the time of instantiation).
2014-03-07 00:47:42 -05:00
Mike Gerwitz 44a45d1f44
rmtrail now handles single-line comments following trailing comma 2014-03-07 00:47:28 -05:00
Mike Gerwitz 29576cfee4
Corrected GetPropertyDescriptorTest traversal test 2014-03-07 00:45:30 -05:00
Mike Gerwitz 7f8d265877
Corrected override of super-super methods
More generally, this was a problem with not recursing on *all* of the
visibility objects of the supertype's supertype; the public visibility
object was implicitly recursed upon through JavaScript's natural prototype
chain, so this only manifested itself with protected members.
2014-02-24 23:03:04 -05:00
Mike Gerwitz 9a3a71bc33
Added test/runner to run individual test cases
The check/test/test-suite make targets can still be used, but this at least
allows running specific test cases from the command line, which is extremely
useful during development.
2014-02-14 00:41:49 -05:00
Mike Gerwitz ff07b4f456
Corrected combine-test throws and doesNotThrow assertions
Did not properly permit empty second argument
2014-02-02 22:20:11 -05:00
Mike Gerwitz 84dd6757bb
Added cwd to NODE_PATH for test-suite
If the cwd was not part of the user's NODE_PATH, the runner would fail
2014-01-29 22:47:22 -05:00
Mike Gerwitz 6152fe9f08
Revert "test-suite target now depends upon combine"
This reverts commit e0790b5281.

It is better to leave this out, because the availability of the combined
source file will trigger the combined test cases, which in turn makes
test-driven development frustrating because you are spammed with combined
errors, which duplicates the first-encountered case error.
2014-01-21 23:00:03 -05:00
Mike Gerwitz 6ab047b793
Updated copyright years for recently modified files 2014-01-20 22:56:40 -05:00
Mike Gerwitz 89f00e0cdd [copyright] Copyright update 2014-01-20 22:55:29 -05:00
Mike Gerwitz 10156cde0f
Reduced README.md length and updated links
Now that full documentation is available and concise examples are on the
ease.js homepage, this lengthy README.md is no longer needed.
2014-01-20 22:55:04 -05:00
Mike Gerwitz ca3ebb53cc Simplified README.md and updated links 2014-01-20 22:54:05 -05:00
Mike Gerwitz 05a09763c4
Test case cleanup and suite integration
All test cases are now part of the xUnit-style suite, have been cleaned up
significantly, and all tests now include rationale in the preceding
docblock.

This project invests a great deal of time into testing; I trust that it
shows in its quality and stability.
2014-01-20 22:29:55 -05:00
Mike Gerwitz e0790b5281 test-suite target now depends upon combine
Otherwise the combined tests cannot run.
2014-01-20 22:28:49 -05:00
Mike Gerwitz 6ed39950f2 Combine script now recognizes new index and combine test case names 2014-01-20 22:26:05 -05:00
Mike Gerwitz 8789be1c4a Test suite will now output thrown data if stack not available 2014-01-20 22:23:22 -05:00
Mike Gerwitz 54fec8e5c6 Removed unit test refactoring mention from README.todo 2014-01-20 22:14:42 -05:00
Mike Gerwitz d4c83a1448 Removed old test-*.js reference from Makefile 2014-01-20 22:14:42 -05:00
Mike Gerwitz ed0a784d9a Moved final test test-combine-pre-es5 into suite as CombinedPreES5Test
Holy hell that was a long and tedious process. It's nice to finally have
everything in the new test suite.

Still plenty of work to be done with refactoring (both the library and test
cases), though.
2014-01-20 22:14:42 -05:00
Mike Gerwitz 9fe55c54d6 Moved test-combine into suite as CombineTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz 476f86723e Test runner will not output duplicate newline before results when total % 60 2014-01-20 22:14:42 -05:00
Mike Gerwitz 2f55d60993 Moved test-index into suite as IndexTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz a3baa99f1c Moved test-interface-name into suite as Interface/TestName 2014-01-20 22:14:42 -05:00
Mike Gerwitz 7b637db815 Moved test-util-prop-parse-keywords into suite as Util/PropParseKeywordsTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz 6c0253c23c Moved test-util-prop-prase into suite as Util/PropParseTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz 202ce8477f Moved test-util-get-property-descriptor into suite as Util/GetPropertyDescriptorTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz 3301f22e69 Moved test-util-abstract into suite as Util/AbstractTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz 086ede6849 Moved test-util-define-secure-prop into suite as Util/DefineSecurePropTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz c75241ca2b Moved test-util-copy into suite as Util/CopyTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz 7b591ba426 Moved test-util-clone into suite as Util/CloneTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz ba1c3044de Moved test-prop_parser-parse-keywords into suite as PropParserKeywordsTest 2014-01-20 22:14:42 -05:00