Bug #39865
Work Package #48275: TypoScript consistency
create proper prototype inheritance
Status: | Resolved | Start date: | 2012-08-16 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | Sebastian Kurfuerst | % Done: | 100% |
|
Category: | - | |||
Target version: | - |
Description
Imagine:
prototype(Matcher) prototype(SpecializedMatcher) < prototype(Matcher) prototype(SomeCaseStatement) < prototype(Case) { # Question: What to do if "matcher.x" is an extension of Matcher? how do we change the prototype for ALL matchers then? # - Idea: remember "inherited" types prototype(Matcher).@override { identifier = ${identifierPrefix + '.' + name} } foo = SpecializedMatcher # now, as foo is a subtype of Matcher, the @override from above should also apply for here :-) # however, this does not happen right now, and implementing it would probably be difficult...
Associated revisions
[!!!][FEATURE] Implement real prototype inheritance
Before this change, the following behavior happened::
prototype(A).test = 'val1'
- this was the "copy" operator
prototype(B) < prototype(A)
- thus, the property 'test2' is NOT set on prototype(B), but
- just on prototype(A)
prototype(A).test2 = 'val2'
With this change, prototype(B) also has property "test2" set; making
TypoScript more ordering independent. The "<" operator on prototypes
now always sets up the prototype inheritance chain, while on simple
properties it copies as before.
This also works with context-dependent prototypes such as
prototype(Foo).prototype(Bar) - this also takes the inheritance into
account, if Foo e.g. has a parent type.
We completely removed the functionality to copy TypoScript prototypes.
Currently, setting up the inheritance chain is only allowed on top level,
such as "prototype(Foo) < prototype(Bar)", but NOT inside a nested
path such as "foo.prototype(Foo) < prototype(Bar)". While this could be
theoretically possible, it makes reasoning about the behavior of TypoScript
a lot more complicated -- that's why we disallow this behavior.
This change also removes the non-used "=<" operator.
In the longer run, e.g. after profiling TypoScript performance, we can
optimize performance by calculating the inheritance chains during
compilation, and not during runtime.
Resolves: #39865
Change-Id: Icfba5063e51948f065e8e315240b59ae67f89c98
History
#1 Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17573
#2 Updated by Sebastian Kurfuerst over 2 years ago
- Status changed from New to Under Review
- Assigned To set to Sebastian Kurfuerst
- Priority changed from Should have to Must have
#3 Updated by Sebastian Kurfuerst about 2 years ago
- Parent task set to #48275
#4 Updated by Gerrit Code Review about 2 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17573
#5 Updated by Gerrit Code Review about 2 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17573
#6 Updated by Sebastian Kurfuerst about 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset a9717553d380e8bf0495c8688c6e71dcb4a4e20e.