jscript: Properly handle NULL bstr in str_to_number.
[wine/multimedia.git] / dlls / jscript / tests / cc.js
blob1fee93fc6949f37424e47559a9c67ff129548fbb
1 /*
2  * Copyright 2010 Jacek Caban for CodeWeavers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
19 eval("@_jscript_version");
21 var tmp;
23 /*@ */
24 //@cc_on @*/
26 @_jscript_version;
28 @cc_on
29 @*/
31 // Standard predefined variabled
32 if(isWin64) {
33     ok(@_win64 === true, "@_win64 = " + @_win64);
34     ok(@_amd64 === true, "@_amd64 = " + @_amd64);
35     ok(isNaN(@_win32), "@_win32 = " + @_win32);
36     ok(isNaN(@_x86), "@_x86 = " + @_x86);
37 }else {
38     ok(@_win32 === true, "@_win32 = " + @_win32);
39     ok(@_x86 === true, "@_x86 = " + @_x86);
40     ok(isNaN(@_win64), "@_win64 = " + @_win64);
41     ok(isNaN(@_amd64), "@_amd64 = " + @_amd64);
44 ok(@_jscript === true, "@_jscript = " + @_jscript);
45 ok(@_jscript_build === ScriptEngineBuildVersion(),
46    "@_jscript_build = " + @_jscript_build + " expected " + ScriptEngineBuildVersion());
47 tmp = ScriptEngineMajorVersion() + ScriptEngineMinorVersion()/10;
48 ok(@_jscript_version === tmp, "@_jscript_version = " + @_jscript_version + " expected " + tmp);
49 ok(isNaN(@_win16), "@_win16 = " + @_win16);
50 ok(isNaN(@_mac), "@_mac = " + @_mac);
51 ok(isNaN(@_alpha), "@_alpha = " + @_alpha);
52 ok(isNaN(@_mc680x0), "@_mc680x0 = " + @_mc680x0);
53 ok(isNaN(@_PowerPC), "@_PowerPC = " + @_PowerPC);
55 // Undefined variable
56 ok(isNaN(@xxx), "@xxx = " + @xxx);
57 ok(isNaN(@x$_xx), "@x$_xx = " + @x$_xx);
59 tmp = false;
60 try {
61     eval("/*@cc_on */");
62 }catch(e) {
63     tmp = true;
65 ok(tmp, "expected syntax exception");
67 tmp = false;
68 try {
69     eval("/*@_jscript_version */");
70 }catch(e) {
71     tmp = true;
73 ok(tmp, "expected syntax exception");
75 reportSuccess();