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
0b0e34ab
Commit
0b0e34ab
authored
Apr 17, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Addded parameterized property assignment support.
parent
8b776029
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
5 deletions
+73
-5
compile.c
dlls/jscript/compile.c
+38
-5
dispex.c
dlls/jscript/dispex.c
+5
-0
engine.c
dlls/jscript/engine.c
+29
-0
engine.h
dlls/jscript/engine.h
+1
-0
No files found.
dlls/jscript/compile.c
View file @
0b0e34ab
...
@@ -607,9 +607,43 @@ static HRESULT compile_delete_expression(compiler_ctx_t *ctx, unary_expression_t
...
@@ -607,9 +607,43 @@ static HRESULT compile_delete_expression(compiler_ctx_t *ctx, unary_expression_t
static
HRESULT
compile_assign_expression
(
compiler_ctx_t
*
ctx
,
binary_expression_t
*
expr
,
jsop_t
op
)
static
HRESULT
compile_assign_expression
(
compiler_ctx_t
*
ctx
,
binary_expression_t
*
expr
,
jsop_t
op
)
{
{
BOOL
use_throw_path
=
FALSE
;
unsigned
arg_cnt
=
0
;
HRESULT
hres
;
HRESULT
hres
;
if
(
!
is_memberid_expr
(
expr
->
expression1
->
type
))
{
if
(
expr
->
expression1
->
type
==
EXPR_CALL
)
{
call_expression_t
*
call_expr
=
(
call_expression_t
*
)
expr
->
expression1
;
argument_t
*
arg
;
if
(
op
!=
OP_LAST
)
{
FIXME
(
"op %d not supported on parametrized assign expressions
\n
"
,
op
);
return
E_NOTIMPL
;
}
if
(
is_memberid_expr
(
call_expr
->
expression
->
type
)
&&
call_expr
->
argument_list
)
{
hres
=
compile_memberid_expression
(
ctx
,
call_expr
->
expression
,
fdexNameEnsure
);
if
(
FAILED
(
hres
))
return
hres
;
for
(
arg
=
call_expr
->
argument_list
;
arg
;
arg
=
arg
->
next
)
{
hres
=
compile_expression
(
ctx
,
arg
->
expr
);
if
(
FAILED
(
hres
))
return
hres
;
arg_cnt
++
;
}
}
else
{
use_throw_path
=
TRUE
;
}
}
else
if
(
is_memberid_expr
(
expr
->
expression1
->
type
))
{
hres
=
compile_memberid_expression
(
ctx
,
expr
->
expression1
,
fdexNameEnsure
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
use_throw_path
=
TRUE
;
}
if
(
use_throw_path
)
{
/* Illegal assignment: evaluate and throw */
hres
=
compile_expression
(
ctx
,
expr
->
expression1
);
hres
=
compile_expression
(
ctx
,
expr
->
expression1
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
@@ -624,10 +658,6 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_
...
@@ -624,10 +658,6 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_
return
push_instr_uint
(
ctx
,
OP_throw_ref
,
JS_E_ILLEGAL_ASSIGN
);
return
push_instr_uint
(
ctx
,
OP_throw_ref
,
JS_E_ILLEGAL_ASSIGN
);
}
}
hres
=
compile_memberid_expression
(
ctx
,
expr
->
expression1
,
fdexNameEnsure
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
op
!=
OP_LAST
&&
!
push_instr
(
ctx
,
OP_refval
))
if
(
op
!=
OP_LAST
&&
!
push_instr
(
ctx
,
OP_refval
))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -638,6 +668,9 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_
...
@@ -638,6 +668,9 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_
if
(
op
!=
OP_LAST
&&
!
push_instr
(
ctx
,
op
))
if
(
op
!=
OP_LAST
&&
!
push_instr
(
ctx
,
op
))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
if
(
arg_cnt
)
return
push_instr_uint
(
ctx
,
OP_assign_call
,
arg_cnt
);
if
(
!
push_instr
(
ctx
,
OP_assign
))
if
(
!
push_instr
(
ctx
,
OP_assign
))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
...
dlls/jscript/dispex.c
View file @
0b0e34ab
...
@@ -1030,6 +1030,11 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, DIS
...
@@ -1030,6 +1030,11 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, DIS
jsdisp
=
iface_to_jsdisp
((
IUnknown
*
)
disp
);
jsdisp
=
iface_to_jsdisp
((
IUnknown
*
)
disp
);
if
(
jsdisp
)
{
if
(
jsdisp
)
{
if
(
flags
&
DISPATCH_PROPERTYPUT
)
{
FIXME
(
"disp_call(propput) on builtin object
\n
"
);
return
E_FAIL
;
}
hres
=
jsdisp_call
(
jsdisp
,
id
,
flags
,
dp
,
retv
,
ei
);
hres
=
jsdisp_call
(
jsdisp
,
id
,
flags
,
dp
,
retv
,
ei
);
jsdisp_release
(
jsdisp
);
jsdisp_release
(
jsdisp
);
return
hres
;
return
hres
;
...
...
dlls/jscript/engine.c
View file @
0b0e34ab
...
@@ -2382,6 +2382,35 @@ static HRESULT interp_assign(exec_ctx_t *ctx)
...
@@ -2382,6 +2382,35 @@ static HRESULT interp_assign(exec_ctx_t *ctx)
return
stack_push
(
ctx
,
v
);
return
stack_push
(
ctx
,
v
);
}
}
/* JScript extension */
static
HRESULT
interp_assign_call
(
exec_ctx_t
*
ctx
)
{
const
unsigned
arg
=
ctx
->
code
->
instrs
[
ctx
->
ip
].
arg1
.
uint
;
DISPID
propput_dispid
=
DISPID_PROPERTYPUT
;
IDispatch
*
disp
;
DISPPARAMS
dp
;
VARIANT
*
v
;
DISPID
id
;
HRESULT
hres
;
TRACE
(
"%u
\n
"
,
arg
);
disp
=
stack_topn_objid
(
ctx
,
arg
+
1
,
&
id
);
if
(
!
disp
)
return
throw_reference_error
(
ctx
->
script
,
ctx
->
ei
,
JS_E_ILLEGAL_ASSIGN
,
NULL
);
jsstack_to_dp
(
ctx
,
arg
+
1
,
&
dp
);
dp
.
cNamedArgs
=
1
;
dp
.
rgdispidNamedArgs
=
&
propput_dispid
;
hres
=
disp_call
(
ctx
->
script
,
disp
,
id
,
DISPATCH_PROPERTYPUT
,
&
dp
,
NULL
,
ctx
->
ei
);
if
(
FAILED
(
hres
))
return
hres
;
v
=
stack_pop
(
ctx
);
stack_popn
(
ctx
,
arg
+
2
);
return
stack_push
(
ctx
,
v
);
}
static
HRESULT
interp_undefined
(
exec_ctx_t
*
ctx
)
static
HRESULT
interp_undefined
(
exec_ctx_t
*
ctx
)
{
{
VARIANT
v
;
VARIANT
v
;
...
...
dlls/jscript/engine.h
View file @
0b0e34ab
...
@@ -64,6 +64,7 @@ typedef struct {
...
@@ -64,6 +64,7 @@ typedef struct {
X(and, 1, 0,0) \
X(and, 1, 0,0) \
X(array, 1, 0,0) \
X(array, 1, 0,0) \
X(assign, 1, 0,0) \
X(assign, 1, 0,0) \
X(assign_call,1, ARG_UINT, 0) \
X(bool, 1, ARG_INT, 0) \
X(bool, 1, ARG_INT, 0) \
X(bneg, 1, 0,0) \
X(bneg, 1, 0,0) \
X(call, 1, ARG_UINT, ARG_UINT) \
X(call, 1, ARG_UINT, ARG_UINT) \
...
...
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