Closed Ventajou closed 12 years ago
Consider the following:
class BaseClass { public virtual string[] Foo { get { return new[] { "Base" }; } } public BaseClass() { console.log(Foo); } } class ChildClass : BaseClass { private string[] _bar = new string[] { "Child" }; public override string[] Foo { get { return _bar; } } public ChildClass() : base() { } }
The compiled JavaScript will actually initialize the array out of order, which is inconsistent with how c# works:
ChildClass = (function() { Blade.derive(ChildClass, BaseClass); var $base = BaseClass.prototype; function ChildClass() { $base.constructor.call(this); this._bar = ['Child']; } var p = ChildClass.prototype; p.get_Foo = function() { return this._bar; }; return ChildClass; })();
Fixed by commit 790c401ed4c8aed068d4faba142132f601229a96
Consider the following:
The compiled JavaScript will actually initialize the array out of order, which is inconsistent with how c# works: