mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 12:15:51 +00:00
23 lines
444 B
JavaScript
23 lines
444 B
JavaScript
load("verify.js");
|
|
|
|
class C {
|
|
var a:String;
|
|
|
|
constructor C(p:String) {this.a = "New "+p}
|
|
constructor make(p:String) {this.a = "Make "+p}
|
|
static function obtain(p:String):C {return new C(p)}
|
|
}
|
|
|
|
var c:C = new C("one");
|
|
var d:C = C.C("two");
|
|
var e:C = C.make("three");
|
|
var f:C = C.obtain("four");
|
|
|
|
verify( c.a, "New one" );
|
|
verify( d.a, "New two" );
|
|
verify( e.a, "Make three" );
|
|
verify( f.a, "New four" );
|
|
|
|
|
|
|