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
c7c71b87
Commit
c7c71b87
authored
Mar 08, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Pass msg as jsstr_t to create_error.
parent
b8e2edf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
error.c
dlls/jscript/error.c
+21
-21
No files found.
dlls/jscript/error.c
View file @
c7c71b87
...
@@ -180,10 +180,9 @@ static HRESULT alloc_error(script_ctx_t *ctx, jsdisp_t *prototype,
...
@@ -180,10 +180,9 @@ static HRESULT alloc_error(script_ctx_t *ctx, jsdisp_t *prototype,
}
}
static
HRESULT
create_error
(
script_ctx_t
*
ctx
,
jsdisp_t
*
constr
,
static
HRESULT
create_error
(
script_ctx_t
*
ctx
,
jsdisp_t
*
constr
,
UINT
number
,
const
WCHAR
*
msg
,
jsdisp_t
**
ret
)
UINT
number
,
jsstr_t
*
msg
,
jsdisp_t
**
ret
)
{
{
jsdisp_t
*
err
;
jsdisp_t
*
err
;
jsstr_t
*
str
;
HRESULT
hres
;
HRESULT
hres
;
hres
=
alloc_error
(
ctx
,
NULL
,
constr
,
&
err
);
hres
=
alloc_error
(
ctx
,
NULL
,
constr
,
&
err
);
...
@@ -196,16 +195,9 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr,
...
@@ -196,16 +195,9 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr,
return
hres
;
return
hres
;
}
}
if
(
msg
)
str
=
jsstr_alloc
(
msg
);
hres
=
jsdisp_propput_name
(
err
,
messageW
,
jsval_string
(
msg
));
else
str
=
jsstr_empty
();
if
(
SUCCEEDED
(
hres
))
if
(
str
)
{
hres
=
jsdisp_propput_dontenum
(
err
,
descriptionW
,
jsval_string
(
msg
));
hres
=
jsdisp_propput_name
(
err
,
messageW
,
jsval_string
(
str
));
if
(
SUCCEEDED
(
hres
))
hres
=
jsdisp_propput_dontenum
(
err
,
descriptionW
,
jsval_string
(
str
));
jsstr_release
(
str
);
}
else
{
hres
=
E_OUTOFMEMORY
;
}
if
(
FAILED
(
hres
))
{
if
(
FAILED
(
hres
))
{
jsdisp_release
(
err
);
jsdisp_release
(
err
);
return
hres
;
return
hres
;
...
@@ -235,19 +227,21 @@ static HRESULT error_constr(script_ctx_t *ctx, WORD flags, unsigned argc, jsval_
...
@@ -235,19 +227,21 @@ static HRESULT error_constr(script_ctx_t *ctx, WORD flags, unsigned argc, jsval_
num
=
n
;
num
=
n
;
}
}
if
(
argc
>
1
&&
!
msg
)
{
if
(
!
msg
)
{
hres
=
to_string
(
ctx
,
argv
[
1
],
&
msg
);
if
(
argc
>
1
)
{
if
(
FAILED
(
hres
))
hres
=
to_string
(
ctx
,
argv
[
1
],
&
msg
);
return
hres
;
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
msg
=
jsstr_empty
();
}
}
}
switch
(
flags
)
{
switch
(
flags
)
{
case
INVOKE_FUNC
:
case
INVOKE_FUNC
:
case
DISPATCH_CONSTRUCT
:
case
DISPATCH_CONSTRUCT
:
hres
=
create_error
(
ctx
,
constr
,
num
,
msg
?
msg
->
str
:
NULL
,
&
err
);
hres
=
create_error
(
ctx
,
constr
,
num
,
msg
,
&
err
);
if
(
msg
)
jsstr_release
(
msg
);
jsstr_release
(
msg
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
@@ -375,6 +369,7 @@ static HRESULT throw_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str, j
...
@@ -375,6 +369,7 @@ static HRESULT throw_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str, j
{
{
WCHAR
buf
[
1024
],
*
pos
=
NULL
;
WCHAR
buf
[
1024
],
*
pos
=
NULL
;
jsdisp_t
*
err
;
jsdisp_t
*
err
;
jsstr_t
*
msg
;
HRESULT
hres
;
HRESULT
hres
;
if
(
!
is_jscript_error
(
error
))
if
(
!
is_jscript_error
(
error
))
...
@@ -392,7 +387,12 @@ static HRESULT throw_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str, j
...
@@ -392,7 +387,12 @@ static HRESULT throw_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str, j
WARN
(
"%s
\n
"
,
debugstr_w
(
buf
));
WARN
(
"%s
\n
"
,
debugstr_w
(
buf
));
hres
=
create_error
(
ctx
,
constr
,
error
,
buf
,
&
err
);
msg
=
jsstr_alloc
(
buf
);
if
(
!
msg
)
return
E_OUTOFMEMORY
;
hres
=
create_error
(
ctx
,
constr
,
error
,
msg
,
&
err
);
jsstr_release
(
msg
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
...
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