2755{
2757
2760
2763 win_skip(
"Could not create script\n");
2765 }
2766 IActiveScript_Release(
script);
2767 }
2768
2770
2773
2779
2785
2791
2797
2803
2805 parse_script_a(
"ok((delete testObj.deleteTest) === true, 'delete testObj.deleteTest did not return true');");
2807
2809 parse_script_a(
"ok((delete testObj.noDeleteTest) === false, 'delete testObj.noDeleteTest did not return false');");
2811
2814 parse_script_a(
"ok((delete testPropDelete) === true, 'delete testPropDelete did not return true');");
2817
2820 parse_script_a(
"ok((delete testNoPropDelete) === false, 'delete testPropDelete did not return false');");
2823
2829
2831 parse_script_a(
"ok((delete pureDisp.prop) === false, 'delete pureDisp.prop did not return true');");
2833
2835 parse_script_a(
"ok((delete pureDisp.noprop) === true, 'delete pureDisp.noprop did not return false');");
2837
2841
2845
2849
2851 parse_script_a(
"var t = {func: dispexFunc}; t = t.func(false);");
2853
2855 parse_script_a(
"Function.prototype.apply.call(dispexFunc, testObj, [true]);");
2857
2859 parse_script_a(
"Function.prototype.apply.call(pureDisp, testObj, [true]);");
2861
2863
2864 parse_script_a(
"ok(typeof(test) === 'object', \"typeof(test) != 'object'\");");
2865
2867
2871
2875
2877
2881
2885
2888 parse_script_a(
"(function () { eval('var testPropGet;'); })();");
2889
2891 parse_script_a(
"ok(propGetFunc() == 0, \"Incorrect propGetFunc value\");");
2893 parse_script_a(
"ok(propGetFunc(1) == 1, \"Incorrect propGetFunc value\");");
2894 parse_script_a(
"ok(propGetFunc(1, 2) == 2, \"Incorrect propGetFunc value\");");
2896 parse_script_a(
"ok(propGetFunc().toString() == 0, \"Incorrect propGetFunc value\");");
2898 parse_script_a(
"ok(propGetFunc(1).toString() == 1, \"Incorrect propGetFunc value\");");
2902
2904
2905 parse_script_a(
"(function() { var tmp = (function () { return testObj; })()(1);})();");
2906 parse_script_a(
"(function() { var tmp = (function () { return testObj; })()();})();");
2907
2908 parse_script_a(
"ok((testObj instanceof Object) === false, 'testObj is instance of Object');");
2909
2911 parse_script_a(
"ok(('prop' in testObj) === true, 'prop is not in testObj');");
2913
2915 parse_script_a(
"ok(('noprop' in testObj) === false, 'noprop is in testObj');");
2917
2919 parse_script_a(
"ok(Object.prototype.hasOwnProperty.call(testObj, 'prop') === true, 'hasOwnProperty(\\\"prop\\\") returned false');");
2921
2923 parse_script_a(
"ok(Object.prototype.hasOwnProperty.call(testObj, 'noprop') === false, 'hasOwnProperty(\\\"noprop\\\") returned true');");
2925
2927 parse_script_a(
"ok(Object.prototype.hasOwnProperty.call(pureDisp, 'prop') === true, 'hasOwnProperty(\\\"noprop\\\") returned false');");
2929
2931 parse_script_a(
"ok(Object.prototype.hasOwnProperty.call(pureDisp, 'noprop') === false, 'hasOwnProperty(\\\"noprop\\\") returned true');");
2933
2935 parse_script_a(
"ok(String(testObj) === '1', 'wrong testObj value');");
2937
2939 parse_script_a(
"ok(String.prototype.concat.call(testObj, ' OK') === '1 OK', 'wrong concat result');");
2941
2945
2951
2957
2963
2967 parse_script_a(
"var t = {func: function () { ok(this === t, 'this !== t'); }}; with(t) { func(); }");
2968 parse_script_a(
"function x() { testThis(this); }; with({y: 1}) { x(); }");
2969 parse_script_a(
"(function () { function x() { testThis(this);} x(); })();");
2970
2973 parse_script_a(
"ok(typeof(testObj.onlyDispID) === 'unknown', 'unexpected typeof(testObj.onlyDispID)');");
2976
2982
2988
2996
3004
3006 parse_script_a(
"testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp,"
3007 "function(i1,ui1,ui2,r4,i4ref,ui4,nullunk,d,i,s) {"
3008 " ok(getVT(i) === 'VT_I4', 'getVT(i) = ' + getVT(i));"
3009 " ok(getVT(s) === 'VT_I4', 'getVT(s) = ' + getVT(s));"
3010 " ok(getVT(d) === 'VT_DISPATCH', 'getVT(d) = ' + getVT(d));"
3011 " ok(getVT(nullunk) === 'VT_DISPATCH', 'getVT(nullunk) = ' + getVT(nullunk));"
3012 " ok(nullunk === null, 'nullunk !== null');"
3013 " ok(getVT(ui4) === 'VT_R8', 'getVT(ui4) = ' + getVT(ui4));"
3014 " ok(ui4 > 0, 'ui4 = ' + ui4);"
3015 " ok(getVT(i4ref) === 'VT_I4', 'getVT(i4ref) = ' + getVT(i4ref));"
3016 " ok(i4ref === 2, 'i4ref = ' + i4ref);"
3017 " ok(r4 === 0.5, 'r4 = ' + r4);"
3018 " ok(getVT(r4) === 'VT_R8', 'getVT(r4) = ' + getVT(r4));"
3019 " ok(getVT(ui2) === 'VT_I4', 'getVT(ui2) = ' + getVT(ui2));"
3020 " ok(getVT(ui1) === 'VT_I4', 'getVT(ui1) = ' + getVT(ui1));"
3021 " ok(ui1 === 4, 'ui1 = ' + ui1);"
3022 " ok(getVT(i1) === 'VT_I4', 'getVT(i1) = ' + getVT(i1));"
3023 " ok(i1 === 5, 'i1 = ' + i1);"
3024 "});");
3026
3029 parse_script_a(
"var t = (function () { with(testObj) { return withProp; }})(); ok(t === 1, 't = ' + t);");
3032
3034
3037 parse_script_a(
"@if(true)\nif(@_jscript) reportSuccess();\n@end");
3040
3048
3055 " var testEnumObj = new Enumerator(testObj);"
3056 " var tmp = testEnumObj.moveFirst();"
3057 " ok(tmp == undefined, \"testEnumObj.moveFirst() = \" + tmp);"
3058 "})()");
3062
3069 " var testEnumObj = new Enumerator(testObj);"
3070 " while (!testEnumObj.atEnd())"
3071 " {"
3072 " ok(testEnumObj.item() == 123, "
3073 " \"testEnumObj.item() = \"+testEnumObj.item());"
3074 " testEnumObj.moveNext();"
3075 " }"
3076 "})()");
3080
3085
3090
3093
3105 ok(
hres !=
S_OK,
"ParseScriptText have not failed\n");
3106
3110
3112 "?",
3113 0x800a03ea, 0, 0,
3114 "Microsoft JScript compilation error",
3115 "Syntax error",
3116 "?");
3117
3119 "var a=1;\nif(a\n-->0) a=5;\n",
3120 0x800a03ee, 2, 0,
3121 "Microsoft JScript compilation error",
3122 "Expected ')'",
3123 "-->0) a=5;");
3124
3126 "new 3;",
3127 0x800a01bd, 0, 0,
3128 "Microsoft JScript runtime error",
3129 "Object doesn't support this action",
3131
3133 "new null;",
3134 0x800a138f, 0, 0,
3135 "Microsoft JScript runtime error",
3136 "Object expected",
3138
3140 "var a;\nnew null;",
3141 0x800a138f, 1, 0,
3142 "Microsoft JScript runtime error",
3143 "Object expected",
3145
3147 "var a; new null;",
3148 0x800a138f, 0, 7,
3149 "Microsoft JScript runtime error",
3150 "Object expected",
3152
3154
3156}
static void test_isvisible(void)
static void test_invokeex(void)
static void test_eval(void)
static void parse_script_with_error_a(const char *src, SCODE errorcode, ULONG line, LONG pos, LPCSTR source, LPCSTR desc, LPCSTR linetext)
static void run_from_res(const char *name)
static void test_script_exprs(void)
static void parse_script_ae(const char *src, HRESULT exhres)
static void run_bom_tests(void)
static void test_automagic(void)
static void test_start(void)
#define parse_htmlscript_a(a)