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
a8de7904
Commit
a8de7904
authored
Sep 16, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added support for default getters.
parent
a03ad6b2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
9 deletions
+33
-9
compile.c
dlls/vbscript/compile.c
+19
-4
interp.c
dlls/vbscript/interp.c
+3
-2
parser.y
dlls/vbscript/parser.y
+1
-2
lang.vbs
dlls/vbscript/tests/lang.vbs
+8
-0
vbscript.h
dlls/vbscript/vbscript.h
+2
-1
No files found.
dlls/vbscript/compile.c
View file @
a8de7904
...
...
@@ -684,6 +684,7 @@ static HRESULT compile_func(compile_ctx_t *ctx, statement_t *stat, function_t *f
case
FUNC_PROPGET
:
case
FUNC_PROPLET
:
case
FUNC_PROPSET
:
case
FUNC_DEFGET
:
ctx
->
prop_end_label
=
alloc_label
(
ctx
);
if
(
ctx
->
prop_end_label
==
-
1
)
return
E_OUTOFMEMORY
;
...
...
@@ -846,6 +847,7 @@ static HRESULT create_class_funcprop(compile_ctx_t *ctx, function_decl_t *func_d
case
FUNC_FUNCTION
:
case
FUNC_SUB
:
case
FUNC_PROPGET
:
case
FUNC_DEFGET
:
invoke_type
=
VBDISP_CALLGET
;
break
;
case
FUNC_PROPLET
:
...
...
@@ -885,7 +887,7 @@ static BOOL lookup_class_funcs(class_desc_t *class_desc, const WCHAR *name)
static
HRESULT
compile_class
(
compile_ctx_t
*
ctx
,
class_decl_t
*
class_decl
)
{
function_decl_t
*
func_decl
;
function_decl_t
*
func_decl
,
*
func_prop_decl
;
class_prop_decl_t
*
prop_decl
;
class_desc_t
*
class_desc
;
unsigned
i
;
...
...
@@ -908,8 +910,14 @@ static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl)
class_desc
->
func_cnt
=
1
;
/* always allocate slot for default getter */
class_desc
->
prop_cnt
=
0
;
for
(
func_decl
=
class_decl
->
funcs
;
func_decl
;
func_decl
=
func_decl
->
next
)
class_desc
->
func_cnt
++
;
for
(
func_decl
=
class_decl
->
funcs
;
func_decl
;
func_decl
=
func_decl
->
next
)
{
for
(
func_prop_decl
=
func_decl
;
func_prop_decl
;
func_prop_decl
=
func_prop_decl
->
next_prop_func
)
{
if
(
func_prop_decl
->
type
==
FUNC_DEFGET
)
break
;
}
if
(
!
func_prop_decl
)
class_desc
->
func_cnt
++
;
}
class_desc
->
funcs
=
compiler_alloc
(
ctx
->
code
,
class_desc
->
func_cnt
*
sizeof
(
*
class_desc
->
funcs
));
if
(
!
class_desc
->
funcs
)
...
...
@@ -917,7 +925,14 @@ static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl)
memset
(
class_desc
->
funcs
,
0
,
class_desc
->
func_cnt
*
sizeof
(
*
class_desc
->
funcs
));
for
(
func_decl
=
class_decl
->
funcs
,
i
=
1
;
func_decl
;
func_decl
=
func_decl
->
next
,
i
++
)
{
hres
=
create_class_funcprop
(
ctx
,
func_decl
,
class_desc
->
funcs
+
i
);
for
(
func_prop_decl
=
func_decl
;
func_prop_decl
;
func_prop_decl
=
func_prop_decl
->
next_prop_func
)
{
if
(
func_prop_decl
->
type
==
FUNC_DEFGET
)
{
i
--
;
break
;
}
}
hres
=
create_class_funcprop
(
ctx
,
func_decl
,
class_desc
->
funcs
+
(
func_prop_decl
?
0
:
i
));
if
(
FAILED
(
hres
))
return
hres
;
}
...
...
dlls/vbscript/interp.c
View file @
a8de7904
...
...
@@ -92,7 +92,8 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
DISPID
id
;
HRESULT
hres
;
if
(
invoke_type
==
VBDISP_LET
&&
(
ctx
->
func
->
type
==
FUNC_FUNCTION
||
ctx
->
func
->
type
==
FUNC_PROPGET
)
if
(
invoke_type
==
VBDISP_LET
&&
(
ctx
->
func
->
type
==
FUNC_FUNCTION
||
ctx
->
func
->
type
==
FUNC_PROPGET
||
ctx
->
func
->
type
==
FUNC_DEFGET
)
&&
!
strcmpiW
(
name
,
ctx
->
func
->
name
))
{
ref
->
type
=
REF_VAR
;
ref
->
u
.
v
=
&
ctx
->
ret_val
;
...
...
@@ -1237,7 +1238,7 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, IDispatch *this_obj, DI
}
assert
(
!
exec
.
top
);
if
(
func
->
type
!=
FUNC_FUNCTION
&&
func
->
type
!=
FUNC_PROPGET
)
if
(
func
->
type
!=
FUNC_FUNCTION
&&
func
->
type
!=
FUNC_PROPGET
&&
func
->
type
!=
FUNC_DEFGET
)
assert
(
V_VT
(
&
exec
.
ret_val
)
==
VT_EMPTY
);
if
(
SUCCEEDED
(
hres
)
&&
res
)
{
...
...
dlls/vbscript/parser.y
View file @
a8de7904
...
...
@@ -602,8 +602,7 @@ static function_decl_t *new_function_decl(parser_ctx_t *ctx, const WCHAR *name,
if(storage_flags & STORAGE_IS_DEFAULT) {
if(type == FUNC_PROPGET) {
FIXME("default value not implemented\n");
ctx->hres = E_NOTIMPL;
type = FUNC_DEFGET;
}else {
FIXME("Invalid default property\n");
ctx->hres = E_FAIL;
...
...
dlls/vbscript/tests/lang.vbs
View file @
a8de7904
...
...
@@ -406,6 +406,14 @@ Class TestClass
Call
ok
(
false
,
"exit property not returned?"
)
End
Property
Public
Default
Property
Get
DefValGet
DefValGet
=
privateProp
funcCalled
=
"GetDefVal"
End
Property
Public
Property
Let
DefValGet
(
x
)
End
Property
Public
publicProp2
Public
Sub
publicSub
...
...
dlls/vbscript/vbscript.h
View file @
a8de7904
...
...
@@ -214,7 +214,8 @@ typedef enum {
FUNC_SUB
,
FUNC_PROPGET
,
FUNC_PROPLET
,
FUNC_PROPSET
FUNC_PROPSET
,
FUNC_DEFGET
}
function_type_t
;
typedef
struct
{
...
...
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