Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
98223b96
Commit
98223b96
authored
Jul 24, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Throw SyntaxError in eval function.
parent
d1fbdbce
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
4 deletions
+10
-4
error.c
dlls/jscript/error.c
+3
-2
global.c
dlls/jscript/global.c
+1
-1
jscript.h
dlls/jscript/jscript.h
+2
-0
jscript_En.rc
dlls/jscript/jscript_En.rc
+1
-0
parser.y
dlls/jscript/parser.y
+1
-1
resource.h
dlls/jscript/resource.h
+1
-0
api.js
dlls/jscript/tests/api.js
+1
-0
No files found.
dlls/jscript/error.c
View file @
98223b96
...
...
@@ -424,7 +424,8 @@ static HRESULT throw_error(script_ctx_t *ctx, jsexcept_t *ei, UINT id, const WCH
DispatchEx
*
err
;
HRESULT
hres
;
LoadStringW
(
jscript_hinstance
,
id
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
));
buf
[
0
]
=
'\0'
;
LoadStringW
(
jscript_hinstance
,
id
&
0xFFFF
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
));
if
(
str
)
pos
=
strchrW
(
buf
,
'|'
);
if
(
pos
)
{
...
...
@@ -435,7 +436,7 @@ static HRESULT throw_error(script_ctx_t *ctx, jsexcept_t *ei, UINT id, const WCH
WARN
(
"%s
\n
"
,
debugstr_w
(
buf
));
id
|=
0x800A0000
;
id
|=
JSCRIPT_ERROR
;
hres
=
create_error
(
ctx
,
constr
,
&
id
,
buf
,
&
err
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/global.c
View file @
98223b96
...
...
@@ -330,7 +330,7 @@ static HRESULT JSGlobal_eval(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA
hres
=
script_parse
(
dispex
->
ctx
,
V_BSTR
(
arg
),
NULL
,
&
parser_ctx
);
if
(
FAILED
(
hres
))
{
WARN
(
"parse (%s) failed: %08x
\n
"
,
debugstr_w
(
V_BSTR
(
arg
)),
hres
);
return
hres
;
return
throw_syntax_error
(
dispex
->
ctx
,
ei
,
hres
,
NULL
)
;
}
hres
=
exec_source
(
dispex
->
ctx
->
exec_ctx
,
parser_ctx
,
parser_ctx
->
source
,
ei
,
retv
);
...
...
dlls/jscript/jscript.h
View file @
98223b96
...
...
@@ -33,6 +33,8 @@
#include "wine/unicode.h"
#include "wine/list.h"
#define JSCRIPT_ERROR 0x800A0000
typedef
struct
_script_ctx_t
script_ctx_t
;
typedef
struct
_exec_ctx_t
exec_ctx_t
;
typedef
struct
_dispex_prop_t
dispex_prop_t
;
...
...
dlls/jscript/jscript_En.rc
View file @
98223b96
...
...
@@ -26,6 +26,7 @@ STRINGTABLE DISCARDABLE
IDS_INVALID_CALL_ARG "Invalid procedure call or argument"
IDS_NO_PROPERTY "Object doesn't support this property or method"
IDS_ARG_NOT_OPT "Argument not optional"
IDS_SYNTAX_ERROR "Syntax error"
IDS_NOT_FUNC "Function expected"
IDS_NOT_DATE "'[object]' is not a date object"
IDS_NOT_NUM "Number expected"
...
...
dlls/jscript/parser.y
View file @
98223b96
...
...
@@ -1568,7 +1568,7 @@ HRESULT script_parse(script_ctx_t *ctx, const WCHAR *code, const WCHAR *delimite
return E_OUTOFMEMORY;
parser_ctx->ref = 1;
parser_ctx->hres =
E_FAIL
;
parser_ctx->hres =
JSCRIPT_ERROR|IDS_SYNTAX_ERROR
;
parser_ctx->is_html = delimiter && !strcmpiW(delimiter, html_tagW);
parser_ctx->begin = parser_ctx->ptr = code;
...
...
dlls/jscript/resource.h
View file @
98223b96
...
...
@@ -22,6 +22,7 @@
#define IDS_INVALID_CALL_ARG 0x0005
#define IDS_NO_PROPERTY 0x01B6
#define IDS_ARG_NOT_OPT 0x01c1
#define IDS_SYNTAX_ERROR 0x03EA
#define IDS_NOT_FUNC 0x138A
#define IDS_NOT_DATE 0x138E
#define IDS_NOT_NUM 0x1389
...
...
dlls/jscript/tests/api.js
View file @
98223b96
...
...
@@ -1317,5 +1317,6 @@ exception_test(function() {not_existing_variable.something();}, "TypeError", -21
exception_test
(
function
()
{
arr
.
toString
=
Function
.
prototype
.
toString
;
arr
.
toString
();},
"TypeError"
,
-
2146823286
);
exception_test
(
function
()
{
date
();},
"TypeError"
,
-
2146823286
);
exception_test
(
function
()
{
arr
();},
"TypeError"
,
-
2146823286
);
exception_test
(
function
()
{
eval
(
"for(i=0;) {}"
);},
"SyntaxError"
,
-
2146827286
);
reportSuccess
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment