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
daf0b8da
Commit
daf0b8da
authored
Sep 17, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Store exception value as jsval_t instead of VARIANT.
parent
80f7f3c2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
40 deletions
+17
-40
engine.c
dlls/jscript/engine.c
+7
-31
error.c
dlls/jscript/error.c
+1
-1
jscript.c
dlls/jscript/jscript.c
+1
-1
jscript.h
dlls/jscript/jscript.h
+6
-5
jsutils.c
dlls/jscript/jsutils.c
+1
-1
regexp.c
dlls/jscript/regexp.c
+1
-1
No files found.
dlls/jscript/engine.c
View file @
daf0b8da
...
@@ -674,19 +674,9 @@ static HRESULT interp_case(exec_ctx_t *ctx)
...
@@ -674,19 +674,9 @@ static HRESULT interp_case(exec_ctx_t *ctx)
/* ECMA-262 3rd Edition 12.13 */
/* ECMA-262 3rd Edition 12.13 */
static
HRESULT
interp_throw
(
exec_ctx_t
*
ctx
)
static
HRESULT
interp_throw
(
exec_ctx_t
*
ctx
)
{
{
VARIANT
v
;
jsval_t
val
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
TRACE
(
"
\n
"
);
val
=
stack_pop
(
ctx
);
ctx
->
ei
->
val
=
stack_pop
(
ctx
);
hres
=
jsval_to_variant
(
val
,
&
v
);
jsval_release
(
val
);
if
(
FAILED
(
hres
))
return
hres
;
ctx
->
ei
->
var
=
v
;
return
DISP_E_EXCEPTION
;
return
DISP_E_EXCEPTION
;
}
}
...
@@ -778,9 +768,7 @@ static HRESULT interp_end_finally(exec_ctx_t *ctx)
...
@@ -778,9 +768,7 @@ static HRESULT interp_end_finally(exec_ctx_t *ctx)
jsval_release
(
v
);
jsval_release
(
v
);
stack_popn
(
ctx
,
1
);
stack_popn
(
ctx
,
1
);
v
=
stack_pop
(
ctx
);
ctx
->
ei
->
val
=
stack_pop
(
ctx
);
hres
=
jsval_to_variant
(
v
,
&
ctx
->
ei
->
var
);
jsval_release
(
v
);
return
SUCCEEDED
(
hres
)
?
DISP_E_EXCEPTION
:
hres
;
return
SUCCEEDED
(
hres
)
?
DISP_E_EXCEPTION
:
hres
;
}
}
...
@@ -2382,7 +2370,7 @@ OP_LIST
...
@@ -2382,7 +2370,7 @@ OP_LIST
static
HRESULT
unwind_exception
(
exec_ctx_t
*
ctx
)
static
HRESULT
unwind_exception
(
exec_ctx_t
*
ctx
)
{
{
except_frame_t
*
except_frame
;
except_frame_t
*
except_frame
;
VARIANT
except_val
;
jsval_t
except_val
;
BSTR
ident
;
BSTR
ident
;
HRESULT
hres
;
HRESULT
hres
;
...
@@ -2397,7 +2385,7 @@ static HRESULT unwind_exception(exec_ctx_t *ctx)
...
@@ -2397,7 +2385,7 @@ static HRESULT unwind_exception(exec_ctx_t *ctx)
ctx
->
ip
=
except_frame
->
catch_off
;
ctx
->
ip
=
except_frame
->
catch_off
;
except_val
=
ctx
->
ei
->
va
r
;
except_val
=
ctx
->
ei
->
va
l
;
memset
(
ctx
->
ei
,
0
,
sizeof
(
*
ctx
->
ei
));
memset
(
ctx
->
ei
,
0
,
sizeof
(
*
ctx
->
ei
));
ident
=
except_frame
->
ident
;
ident
=
except_frame
->
ident
;
...
@@ -2408,30 +2396,18 @@ static HRESULT unwind_exception(exec_ctx_t *ctx)
...
@@ -2408,30 +2396,18 @@ static HRESULT unwind_exception(exec_ctx_t *ctx)
hres
=
create_dispex
(
ctx
->
script
,
NULL
,
NULL
,
&
scope_obj
);
hres
=
create_dispex
(
ctx
->
script
,
NULL
,
NULL
,
&
scope_obj
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
jsval_t
val
;
hres
=
jsdisp_propput_name
(
scope_obj
,
ident
,
except_val
,
ctx
->
ei
);
hres
=
variant_to_jsval
(
&
except_val
,
&
val
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
jsdisp_propput_name
(
scope_obj
,
ident
,
val
,
ctx
->
ei
);
jsval_release
(
val
);
}
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
jsdisp_release
(
scope_obj
);
jsdisp_release
(
scope_obj
);
}
}
VariantClear
(
&
except_val
);
jsval_release
(
except_val
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
hres
=
scope_push
(
ctx
->
scope_chain
,
scope_obj
,
to_disp
(
scope_obj
),
&
ctx
->
scope_chain
);
hres
=
scope_push
(
ctx
->
scope_chain
,
scope_obj
,
to_disp
(
scope_obj
),
&
ctx
->
scope_chain
);
jsdisp_release
(
scope_obj
);
jsdisp_release
(
scope_obj
);
}
else
{
}
else
{
jsval_t
exceptv
;
hres
=
stack_push
(
ctx
,
except_val
);
hres
=
variant_to_jsval
(
&
except_val
,
&
exceptv
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
stack_push
(
ctx
,
exceptv
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
...
dlls/jscript/error.c
View file @
daf0b8da
...
@@ -400,7 +400,7 @@ static HRESULT throw_error(script_ctx_t *ctx, jsexcept_t *ei, HRESULT error, con
...
@@ -400,7 +400,7 @@ static HRESULT throw_error(script_ctx_t *ctx, jsexcept_t *ei, HRESULT error, con
return
hres
;
return
hres
;
if
(
ei
)
if
(
ei
)
var_set_jsdisp
(
&
ei
->
var
,
err
);
ei
->
val
=
jsval_obj
(
err
);
return
error
;
return
error
;
}
}
...
...
dlls/jscript/jscript.c
View file @
daf0b8da
...
@@ -110,7 +110,7 @@ static HRESULT exec_global_code(JScript *This, bytecode_t *code)
...
@@ -110,7 +110,7 @@ static HRESULT exec_global_code(JScript *This, bytecode_t *code)
memset
(
&
jsexcept
,
0
,
sizeof
(
jsexcept
));
memset
(
&
jsexcept
,
0
,
sizeof
(
jsexcept
));
hres
=
exec_source
(
exec_ctx
,
code
,
&
code
->
global_code
,
FALSE
,
&
jsexcept
,
NULL
);
hres
=
exec_source
(
exec_ctx
,
code
,
&
code
->
global_code
,
FALSE
,
&
jsexcept
,
NULL
);
VariantClear
(
&
jsexcept
.
var
);
jsval_release
(
jsexcept
.
val
);
exec_release
(
exec_ctx
);
exec_release
(
exec_ctx
);
IActiveScriptSite_OnLeaveScript
(
This
->
site
);
IActiveScriptSite_OnLeaveScript
(
This
->
site
);
...
...
dlls/jscript/jscript.h
View file @
daf0b8da
...
@@ -37,11 +37,7 @@ typedef struct _jsval_t jsval_t;
...
@@ -37,11 +37,7 @@ typedef struct _jsval_t jsval_t;
typedef
struct
_script_ctx_t
script_ctx_t
;
typedef
struct
_script_ctx_t
script_ctx_t
;
typedef
struct
_exec_ctx_t
exec_ctx_t
;
typedef
struct
_exec_ctx_t
exec_ctx_t
;
typedef
struct
_dispex_prop_t
dispex_prop_t
;
typedef
struct
_dispex_prop_t
dispex_prop_t
;
typedef
struct
_jsexcept_t
jsexcept_t
;
typedef
struct
{
EXCEPINFO
ei
;
VARIANT
var
;
}
jsexcept_t
;
typedef
struct
{
typedef
struct
{
void
**
blocks
;
void
**
blocks
;
...
@@ -548,3 +544,8 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
...
@@ -548,3 +544,8 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
}
}
#include "jsval.h"
#include "jsval.h"
struct
_jsexcept_t
{
EXCEPINFO
ei
;
jsval_t
val
;
};
dlls/jscript/jsutils.c
View file @
daf0b8da
...
@@ -1062,7 +1062,7 @@ HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTY
...
@@ -1062,7 +1062,7 @@ HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTY
}
}
if
(
FAILED
(
hres
))
{
if
(
FAILED
(
hres
))
{
VariantClear
(
&
ei
.
var
);
jsval_release
(
ei
.
val
);
return
hres
;
return
hres
;
}
}
...
...
dlls/jscript/regexp.c
View file @
daf0b8da
...
@@ -3525,7 +3525,7 @@ static INT index_from_val(script_ctx_t *ctx, jsval_t v)
...
@@ -3525,7 +3525,7 @@ static INT index_from_val(script_ctx_t *ctx, jsval_t v)
memset
(
&
ei
,
0
,
sizeof
(
ei
));
memset
(
&
ei
,
0
,
sizeof
(
ei
));
hres
=
to_number_jsval
(
ctx
,
v
,
&
ei
,
&
n
);
hres
=
to_number_jsval
(
ctx
,
v
,
&
ei
,
&
n
);
if
(
FAILED
(
hres
))
{
/* FIXME: Move ignoring exceptions to to_primitive */
if
(
FAILED
(
hres
))
{
/* FIXME: Move ignoring exceptions to to_primitive */
VariantClear
(
&
ei
.
var
);
jsval_release
(
ei
.
val
);
return
0
;
return
0
;
}
}
...
...
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