Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a4acd1b3
Commit
a4acd1b3
authored
Aug 27, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Throw an exception when evaluating invalid identifier instead of on lookup failure.
parent
2c255287
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
engine.c
dlls/jscript/engine.c
+16
-4
engine.h
dlls/jscript/engine.h
+3
-1
No files found.
dlls/jscript/engine.c
View file @
a4acd1b3
...
...
@@ -57,6 +57,9 @@ static void exprval_release(exprval_t *val)
if
(
val
->
u
.
nameref
.
disp
)
IDispatch_Release
(
val
->
u
.
nameref
.
disp
);
SysFreeString
(
val
->
u
.
nameref
.
name
);
return
;
case
EXPRVAL_INVALID
:
SysFreeString
(
val
->
u
.
identifier
);
}
}
...
...
@@ -75,10 +78,14 @@ static HRESULT exprval_value(script_ctx_t *ctx, exprval_t *val, jsexcept_t *ei,
}
return
disp_propget
(
val
->
u
.
idref
.
disp
,
val
->
u
.
idref
.
id
,
ctx
->
lcid
,
ret
,
ei
,
NULL
/*FIXME*/
);
default:
ERR
(
"type %d
\n
"
,
val
->
type
);
return
E_FAIL
;
case
EXPRVAL_NAMEREF
:
break
;
case
EXPRVAL_INVALID
:
return
throw_type_error
(
ctx
,
ei
,
IDS_UNDEFINED
,
val
->
u
.
identifier
);
}
ERR
(
"type %d
\n
"
,
val
->
type
);
return
E_FAIL
;
}
static
HRESULT
exprval_to_value
(
script_ctx_t
*
ctx
,
exprval_t
*
val
,
jsexcept_t
*
ei
,
VARIANT
*
ret
)
...
...
@@ -538,7 +545,12 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, js
return
S_OK
;
}
return
throw_type_error
(
ctx
->
var_disp
->
ctx
,
ei
,
IDS_UNDEFINED
,
identifier
);
ret
->
type
=
EXPRVAL_INVALID
;
ret
->
u
.
identifier
=
SysAllocString
(
identifier
);
if
(
!
ret
->
u
.
identifier
)
return
E_OUTOFMEMORY
;
return
S_OK
;
}
/* ECMA-262 3rd Edition 12.1 */
...
...
dlls/jscript/engine.h
View file @
a4acd1b3
...
...
@@ -272,7 +272,8 @@ typedef struct {
enum
{
EXPRVAL_VARIANT
,
EXPRVAL_IDREF
,
EXPRVAL_NAMEREF
EXPRVAL_NAMEREF
,
EXPRVAL_INVALID
}
type
;
union
{
VARIANT
var
;
...
...
@@ -284,6 +285,7 @@ typedef struct {
IDispatch
*
disp
;
BSTR
name
;
}
nameref
;
BSTR
identifier
;
}
u
;
}
exprval_t
;
...
...
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