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
2a7c9f1b
Commit
2a7c9f1b
authored
Sep 09, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added identifier expression implementation.
parent
eb0bb55d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
3 deletions
+60
-3
engine.c
dlls/jscript/engine.c
+60
-3
No files found.
dlls/jscript/engine.c
View file @
2a7c9f1b
...
...
@@ -86,6 +86,16 @@ static HRESULT exprval_to_value(script_ctx_t *ctx, exprval_t *val, jsexcept_t *e
return
exprval_value
(
ctx
,
val
,
ei
,
ret
);
}
static
void
exprval_set_idref
(
exprval_t
*
val
,
IDispatch
*
disp
,
DISPID
id
)
{
val
->
type
=
EXPRVAL_IDREF
;
val
->
u
.
idref
.
disp
=
disp
;
val
->
u
.
idref
.
id
=
id
;
if
(
disp
)
IDispatch_AddRef
(
disp
);
}
HRESULT
create_exec_ctx
(
exec_ctx_t
**
ret
)
{
exec_ctx_t
*
ctx
;
...
...
@@ -106,6 +116,13 @@ void exec_release(exec_ctx_t *ctx)
heap_free
(
ctx
);
}
static
HRESULT
dispex_get_id
(
IDispatchEx
*
dispex
,
BSTR
name
,
DWORD
flags
,
DISPID
*
id
)
{
*
id
=
0
;
return
IDispatchEx_GetDispID
(
dispex
,
name
,
flags
|
fdexNameCaseSensitive
,
id
);
}
HRESULT
exec_source
(
exec_ctx_t
*
ctx
,
parser_ctx_t
*
parser
,
source_elements_t
*
source
,
jsexcept_t
*
ei
,
VARIANT
*
retv
)
{
script_ctx_t
*
script
=
parser
->
script
;
...
...
@@ -158,6 +175,33 @@ HRESULT exec_source(exec_ctx_t *ctx, parser_ctx_t *parser, source_elements_t *so
return
S_OK
;
}
/* ECMA-262 3rd Edition 10.1.4 */
static
HRESULT
identifier_eval
(
exec_ctx_t
*
ctx
,
BSTR
identifier
,
DWORD
flags
,
exprval_t
*
ret
)
{
DISPID
id
=
0
;
HRESULT
hres
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
identifier
));
/* FIXME: scope chain */
/* FIXME: global */
/* FIXME: named items */
hres
=
dispex_get_id
(
_IDispatchEx_
(
ctx
->
parser
->
script
->
script_disp
),
identifier
,
0
,
&
id
);
if
(
SUCCEEDED
(
hres
))
{
exprval_set_idref
(
ret
,
(
IDispatch
*
)
_IDispatchEx_
(
ctx
->
parser
->
script
->
script_disp
),
id
);
return
S_OK
;
}
if
(
flags
&
EXPR_NEWREF
)
{
FIXME
(
"create ref
\n
"
);
return
E_NOTIMPL
;
}
WARN
(
"Could not find identifier %s
\n
"
,
debugstr_w
(
identifier
));
return
E_FAIL
;
}
HRESULT
block_statement_eval
(
exec_ctx_t
*
ctx
,
statement_t
*
stat
,
return_type_t
*
rt
,
VARIANT
*
ret
)
{
FIXME
(
"
\n
"
);
...
...
@@ -323,10 +367,23 @@ HRESULT this_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, j
return
E_NOTIMPL
;
}
HRESULT
identifier_expression_eval
(
exec_ctx_t
*
ctx
,
expression_t
*
expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
/* ECMA-262 3rd Edition 10.1.4 */
HRESULT
identifier_expression_eval
(
exec_ctx_t
*
ctx
,
expression_t
*
_expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
identifier_expression_t
*
expr
=
(
identifier_expression_t
*
)
_expr
;
BSTR
identifier
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
identifier
=
SysAllocString
(
expr
->
identifier
);
if
(
!
identifier
)
return
E_OUTOFMEMORY
;
hres
=
identifier_eval
(
ctx
,
identifier
,
flags
,
ret
);
SysFreeString
(
identifier
);
return
hres
;
}
HRESULT
literal_expression_eval
(
exec_ctx_t
*
ctx
,
expression_t
*
expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
...
...
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