[MAGNOLIA-1488] javascript: improve class support Created: 26/Apr/07  Updated: 23/Jan/13  Resolved: 10/Oct/07

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 3.5 RC1

Type: Improvement Priority: Major
Reporter: Philipp Bärfuss Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: HTML File test4.html    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

currently the support for members, static methods is in some cases not that clear. To follow one single guideline we have to improve our runtime



 Comments   
Comment by Philipp Bracher [ 26/Apr/07 ]

this html sample shows how class definition and subclassing works now

Comment by Philipp Bracher [ 27/Apr/07 ]

done for now

Comment by Magnolia International [ 30/Apr/07 ]

This does not work with safari 2.0.4
("Parse error" on klass.prototype.super = function(){ .... : line 79 of Runtime.js)

Comment by Magnolia International [ 30/Apr/07 ]

works if we rename super to anything else (tried with zuper) in both Runtime.js and the sample code, AND if the "static" block only contains
{
count: 0
}
without the trailing comma... ?

Comment by Philipp Bracher [ 02/May/07 ]

Super is indeed a reserved name and I was not able to find a good alternative so far. We could also drop this super constructor to enforce to use the constructor directly:

MyParentClass.apply(this, args);

But for now I renamed the method to parentConstuctor()

Comment by Magnolia International [ 02/May/07 ]

ha ! didn't dare to rename this myself; seems it isn't used anywhere yet, right ?

Comment by Philipp Bracher [ 03/May/07 ]

Not used yet. It was my little secrete

Generated at Mon Feb 12 03:27:24 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.