Skip to content

Commit 12d8e2a

Browse files
committed
update
1 parent daff0b7 commit 12d8e2a

File tree

5 files changed

+49
-28
lines changed

5 files changed

+49
-28
lines changed

JSX

example/aobench/aobench.jsx.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -846,19 +846,24 @@ JSX.runTests = function (sourceFile, tests) {
846846
}
847847
}
848848

849-
var test = new testClass();
849+
var testCase = new testClass();
850850

851-
if (test.beforeClass$AS != null)
852-
test.beforeClass$AS(tests);
851+
if (testCase.beforeClass$AS != null)
852+
testCase.beforeClass$AS(tests);
853853

854854
for (var i = 0; i < tests.length; ++i) {
855-
(function (m) {
856-
test.run$SF$V$(m, function() { test[m](); });
855+
(function (method) {
856+
if (method in testCase) {
857+
testCase.run$SF$V$(method, function() { testCase[method](); });
858+
}
859+
else {
860+
throw new ReferenceError("No such test method: " + method);
861+
}
857862
}(tests[i]));
858863
}
859864

860-
if (test.afterClass$ != null)
861-
test.afterClass$();
865+
if (testCase.afterClass$ != null)
866+
testCase.afterClass$();
862867
};
863868
/**
864869
* call a function on load/DOMContentLoaded

source-map/flying-being.jsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// an example for class inheritance and interfaces
22

33
interface Flyable {
4-
abstract function fly() : void;
4+
function fly() : void;
55
}
66

77
abstract class Animal {
@@ -26,20 +26,25 @@ class Bee extends Insect implements Flyable {
2626
}
2727

2828
class _Main {
29+
static function takeAnimal(animal : Animal) : void {
30+
animal.eat();
31+
}
32+
33+
static function takeFlyable(flyingBeing : Flyable) : void {
34+
flyingBeing.fly();
35+
}
36+
2937
static function main(args : string[]) : void {
30-
// fo bar
3138
var bat = new Bat();
3239

33-
var animal : Animal = bat; // OK. A bat is an animal.
34-
animal.eat();
40+
_Main.takeAnimal(bat); // OK. A bat is an animal.
3541

36-
var flyable : Flyable = bat; // OK. A bat can fly
37-
flyable.fly();
42+
_Main.takeFlyable(bat); // OK. A bat can fly.
3843

39-
// for Bee
4044
var bee = new Bee();
4145

42-
flyable = bee; // A bee is also flyable
43-
flyable.fly();
46+
_Main.takeFlyable(bee); // OK. A bee is also flyable.
4447
}
4548
}
49+
50+
// vim: set expandtab:

source-map/flying-being.jsx.js

Lines changed: 21 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":3,"file":"flying-being.jsx.js","sources":["flying-being.jsx"],"names":["Flyable","Animal","eat","Bat","fly","Insect","Bee","_Main","main","args","bat","animal","flyable","bee"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAEUA;;;;;;;;QAAAA;;;;;;;;;QAIKC;;;;;;;QAAAA;;;;;;;gBACFC,OAAT;AACE,YAAI;;;;;;;QAIJC;;;;;;;;;QAAAA;AAAAA,iBAAAA,CAAAA;AAAAA,kBAAAA,CAAAA;;;;;;;aACgBC,OAAT;AACL,YAAI;;;;;;;QAIGC;;;;;;;QAAAA;;;;;;;;;QAGTC;;;;;;;;;QAAAA;AAAAA,iBAAAA,CAAAA;AAAAA,kBAAAA,CAAAA;;;;;;;aACgBF,OAAT;AACL,YAAI;;;;;;;QAING;;;;;;;QAAAA;;;;;;;;KACcC,UAAT,UAAcC;;;;;;;;;AAEbC,GAAI,GAAE,SAAA;AAENC,MAAgB,GAAED;AACtBC,MAAOT,CAAAA,IAAG,CAAA;AAENU,OAAkB,GAAEF;AACxBE,OAAQR,CAAAA,IAAG,CAAA;AAGPS,GAAI,GAAE,SAAA;AAEVD,OAAQ,GAAEC;AACVD,OAAQR,CAAAA,IAAG,CAAA"}
1+
{"version":3,"file":"flying-being.jsx.js","sources":["flying-being.jsx"],"names":["Flyable","Animal","eat","Bat","fly","Insect","Bee","_Main","takeAnimal","animal","takeFlyable","flyingBeing","main","args","bat","bee"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAEUA;;;;;;;;QAAAA;;;;;;;;;QAIKC;;;;;;;QAAAA;;;;;;;gBACFC,OAAT;AACE,YAAI;;;;;;;QAIJC;;;;;;;;;QAAAA;AAAAA,iBAAAA,CAAAA;AAAAA,kBAAAA,CAAAA;;;;;;;aACgBC,OAAT;AACL,YAAI;;;;;;;QAIGC;;;;;;;QAAAA;;;;;;;;;QAGTC;;;;;;;;;QAAAA;AAAAA,iBAAAA,CAAAA;AAAAA,kBAAAA,CAAAA;;;;;;;aACgBF,OAAT;AACL,YAAI;;;;;;;QAING;;;;;;;QAAAA;;;;;;;;KACcC,sBAAT,UAAoBC;AACvBA,MAAOP,CAAAA,IAAG,CAAA;;;;;;;;KAGEQ,wBAAT,UAAqBC;AACxBA,WAAYP,CAAAA,IAAG,CAAA;;;;;;;;KAGHQ,UAAT,UAAcC;;;;;AACbC,GAAI,GAAE,SAAA;KAEJN,CAAAA,mBAAU,CAACM,GAAD;KAEVJ,CAAAA,qBAAW,CAACI,GAAD;AAEbC,GAAI,GAAE,SAAA;KAEJL,CAAAA,qBAAW,CAACK,GAAD"}

0 commit comments

Comments
 (0)