Merge branch 'devel' of https://github.com/Neha03/gsoc2012-javascript into devel
Conflicts: .project COPYRIGHT Doc/Manual/style.css Examples/Makefile.in Examples/test-suite/common.mk Lib/typemaps/strings.swg Makefile.in Source/DOH/fio.c Source/Makefile.am Source/Modules/emit.cxx Source/Modules/javascript.cxx configure.in git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13764 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
360ef44e09
commit
050219d998
136 changed files with 7987 additions and 141 deletions
34
Examples/javascript/enum/runme.js
Executable file
34
Examples/javascript/enum/runme.js
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
// file: runme.py
|
||||
|
||||
// ----- Object creation -----
|
||||
|
||||
// Print out the value of some enums
|
||||
print("*** color ***");
|
||||
print(" RED =" + example.RED);
|
||||
print(" BLUE =" + example.BLUE);
|
||||
print(" GREEN =" + example.GREEN);
|
||||
|
||||
print("\n*** Foo::speed ***");
|
||||
print(" Foo_IMPULSE =" + example.Foo.IMPULSE);
|
||||
print(" Foo_WARP =" + example.Foo.WARP);
|
||||
print(" Foo_LUDICROUS =" + example.Foo.LUDICROUS);
|
||||
|
||||
print("\nTesting use of enums with functions\n");
|
||||
|
||||
example.enum_test(example.RED, example.Foo.IMPULSE);
|
||||
example.enum_test(example.BLUE, example.Foo.WARP);
|
||||
example.enum_test(example.GREEN, example.Foo.LUDICROUS);
|
||||
example.enum_test(1234,5678);
|
||||
|
||||
print("\nTesting use of enum with class method");
|
||||
f = new example.Foo();
|
||||
|
||||
f.enum_test(example.Foo.IMPULSE);
|
||||
f.enum_test(example.Foo.WARP);
|
||||
f.enum_test(example.Foo.LUDICROUS);
|
||||
|
||||
// enum value BLUE of enum color is accessed as property of cconst
|
||||
print("example.BLUE= " + example.BLUE);
|
||||
|
||||
// enum value LUDICROUS of enum Foo::speed is accessed as as property of cconst
|
||||
print("example.speed.LUDICROUS= " + example.Foo.LUDICROUS);
|
||||
Loading…
Add table
Add a link
Reference in a new issue