1
0
Fork 0
Commit Graph

1138 Commits (d4478cdcd1f6aff97ee1e43012f394b4a8827729)

Author SHA1 Message Date
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
Mike Gerwitz 16d0641f46 prop_parse no longer scans the string twice
The performance impact is negligable in either case.
2014-01-20 22:14:42 -05:00
Mike Gerwitz 72da8f2dee Moved test-warn-* tests into suite 2014-01-20 22:14:42 -05:00
Mike Gerwitz aad013bd87 Moved test-class-abstract into suite as Class/AbstractTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz 37d66b375d Moved test-class-gettersetter into suite as Class/GetterSetterTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz 0b1bf31b8d Moved test-class-name into test suite as Class/NameTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz ee886f2d37 Moved test-class-constructor into suite as Class/ConstructorTest
Also removed assertions that are performed elsewhere.

We broke onto the fifth line in the suite ;)
2014-01-20 22:14:42 -05:00
Mike Gerwitz d0bc34a7f3 Moved test-class-parent into test suite as Class/ParentTest 2014-01-20 22:14:42 -05:00
Mike Gerwitz 2b5bcaf02d Moved test-class-extend into suite as Class/{Extend,InstanceSafety}Test
More refactoring to come for ExtendTest at some point
2014-01-20 22:14:42 -05:00
Mike Gerwitz ae367964a3 Moved test-class into suite as Class/GeneralTest
This guy had some old tests indeed; it wasn't even in the second incarnation
of the test formats! Flasback to the beginning of ease.js.
2014-01-20 22:14:42 -05:00