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
0bd508db
Commit
0bd508db
authored
Sep 10, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added this expression implementation.
parent
6b24d897
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
5 deletions
+17
-5
engine.c
dlls/jscript/engine.c
+13
-3
engine.h
dlls/jscript/engine.h
+2
-1
jscript.c
dlls/jscript/jscript.c
+1
-1
lang.js
dlls/jscript/tests/lang.js
+1
-0
No files found.
dlls/jscript/engine.c
View file @
0bd508db
...
@@ -132,7 +132,7 @@ void scope_release(scope_chain_t *scope)
...
@@ -132,7 +132,7 @@ void scope_release(scope_chain_t *scope)
heap_free
(
scope
);
heap_free
(
scope
);
}
}
HRESULT
create_exec_ctx
(
DispatchEx
*
var_disp
,
scope_chain_t
*
scope
,
exec_ctx_t
**
ret
)
HRESULT
create_exec_ctx
(
IDispatch
*
this_obj
,
DispatchEx
*
var_disp
,
scope_chain_t
*
scope
,
exec_ctx_t
**
ret
)
{
{
exec_ctx_t
*
ctx
;
exec_ctx_t
*
ctx
;
...
@@ -140,6 +140,9 @@ HRESULT create_exec_ctx(DispatchEx *var_disp, scope_chain_t *scope, exec_ctx_t *
...
@@ -140,6 +140,9 @@ HRESULT create_exec_ctx(DispatchEx *var_disp, scope_chain_t *scope, exec_ctx_t *
if
(
!
ctx
)
if
(
!
ctx
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
IDispatch_AddRef
(
this_obj
);
ctx
->
this_obj
=
this_obj
;
IDispatchEx_AddRef
(
_IDispatchEx_
(
var_disp
));
IDispatchEx_AddRef
(
_IDispatchEx_
(
var_disp
));
ctx
->
var_disp
=
var_disp
;
ctx
->
var_disp
=
var_disp
;
...
@@ -161,6 +164,8 @@ void exec_release(exec_ctx_t *ctx)
...
@@ -161,6 +164,8 @@ void exec_release(exec_ctx_t *ctx)
scope_release
(
ctx
->
scope_chain
);
scope_release
(
ctx
->
scope_chain
);
if
(
ctx
->
var_disp
)
if
(
ctx
->
var_disp
)
IDispatchEx_Release
(
_IDispatchEx_
(
ctx
->
var_disp
));
IDispatchEx_Release
(
_IDispatchEx_
(
ctx
->
var_disp
));
if
(
ctx
->
this_obj
)
IDispatch_Release
(
ctx
->
this_obj
);
heap_free
(
ctx
);
heap_free
(
ctx
);
}
}
...
@@ -816,8 +821,13 @@ HRESULT call_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags,
...
@@ -816,8 +821,13 @@ HRESULT call_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags,
HRESULT
this_expression_eval
(
exec_ctx_t
*
ctx
,
expression_t
*
expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
HRESULT
this_expression_eval
(
exec_ctx_t
*
ctx
,
expression_t
*
expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
{
{
FIXME
(
"
\n
"
);
TRACE
(
"
\n
"
);
return
E_NOTIMPL
;
ret
->
type
=
EXPRVAL_VARIANT
;
V_VT
(
&
ret
->
u
.
var
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
ret
->
u
.
var
)
=
ctx
->
this_obj
;
IDispatch_AddRef
(
ctx
->
this_obj
);
return
S_OK
;
}
}
/* ECMA-262 3rd Edition 10.1.4 */
/* ECMA-262 3rd Edition 10.1.4 */
...
...
dlls/jscript/engine.h
View file @
0bd508db
...
@@ -76,6 +76,7 @@ struct _exec_ctx_t {
...
@@ -76,6 +76,7 @@ struct _exec_ctx_t {
parser_ctx_t
*
parser
;
parser_ctx_t
*
parser
;
scope_chain_t
*
scope_chain
;
scope_chain_t
*
scope_chain
;
DispatchEx
*
var_disp
;
DispatchEx
*
var_disp
;
IDispatch
*
this_obj
;
};
};
static
inline
void
exec_addref
(
exec_ctx_t
*
ctx
)
static
inline
void
exec_addref
(
exec_ctx_t
*
ctx
)
...
@@ -84,7 +85,7 @@ static inline void exec_addref(exec_ctx_t *ctx)
...
@@ -84,7 +85,7 @@ static inline void exec_addref(exec_ctx_t *ctx)
}
}
void
exec_release
(
exec_ctx_t
*
);
void
exec_release
(
exec_ctx_t
*
);
HRESULT
create_exec_ctx
(
DispatchEx
*
,
scope_chain_t
*
,
exec_ctx_t
**
);
HRESULT
create_exec_ctx
(
IDispatch
*
,
DispatchEx
*
,
scope_chain_t
*
,
exec_ctx_t
**
);
HRESULT
exec_source
(
exec_ctx_t
*
,
parser_ctx_t
*
,
source_elements_t
*
,
jsexcept_t
*
,
VARIANT
*
);
HRESULT
exec_source
(
exec_ctx_t
*
,
parser_ctx_t
*
,
source_elements_t
*
,
jsexcept_t
*
,
VARIANT
*
);
typedef
struct
_statement_t
statement_t
;
typedef
struct
_statement_t
statement_t
;
...
...
dlls/jscript/jscript.c
View file @
0bd508db
...
@@ -80,7 +80,7 @@ static HRESULT exec_global_code(JScript *This, parser_ctx_t *parser_ctx)
...
@@ -80,7 +80,7 @@ static HRESULT exec_global_code(JScript *This, parser_ctx_t *parser_ctx)
VARIANT
var
;
VARIANT
var
;
HRESULT
hres
;
HRESULT
hres
;
hres
=
create_exec_ctx
(
This
->
ctx
->
script_disp
,
NULL
,
&
exec_ctx
);
hres
=
create_exec_ctx
(
(
IDispatch
*
)
_IDispatchEx_
(
This
->
ctx
->
script_disp
),
This
->
ctx
->
script_disp
,
NULL
,
&
exec_ctx
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
...
dlls/jscript/tests/lang.js
View file @
0bd508db
...
@@ -68,5 +68,6 @@ ok(typeof(String.prototype) === "object", "typeof(String.prototype) is not objec
...
@@ -68,5 +68,6 @@ ok(typeof(String.prototype) === "object", "typeof(String.prototype) is not objec
ok
(
typeof
(
testFunc1
)
===
"function"
,
"typeof(testFunc1) is not function"
);
ok
(
typeof
(
testFunc1
)
===
"function"
,
"typeof(testFunc1) is not function"
);
ok
(
typeof
(
String
)
===
"function"
,
"typeof(String) is not function"
);
ok
(
typeof
(
String
)
===
"function"
,
"typeof(String) is not function"
);
ok
(
typeof
(
ScriptEngine
)
===
"function"
,
"typeof(ScriptEngine) is not function"
);
ok
(
typeof
(
ScriptEngine
)
===
"function"
,
"typeof(ScriptEngine) is not function"
);
ok
(
typeof
(
this
)
===
"object"
,
"typeof(this) is not object"
);
reportSuccess
();
reportSuccess
();
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