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
56b04194
Commit
56b04194
authored
Nov 04, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Don't return function value it's unless explicitly returned.
parent
0839ae88
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
6 deletions
+18
-6
engine.c
dlls/jscript/engine.c
+3
-2
engine.h
dlls/jscript/engine.h
+7
-1
function.c
dlls/jscript/function.c
+1
-1
global.c
dlls/jscript/global.c
+1
-1
jscript.c
dlls/jscript/jscript.c
+1
-1
lang.js
dlls/jscript/tests/lang.js
+5
-0
No files found.
dlls/jscript/engine.c
View file @
56b04194
...
...
@@ -414,7 +414,8 @@ static BOOL lookup_global_members(script_ctx_t *ctx, BSTR identifier, exprval_t
return
FALSE
;
}
HRESULT
exec_source
(
exec_ctx_t
*
ctx
,
parser_ctx_t
*
parser
,
source_elements_t
*
source
,
jsexcept_t
*
ei
,
VARIANT
*
retv
)
HRESULT
exec_source
(
exec_ctx_t
*
ctx
,
parser_ctx_t
*
parser
,
source_elements_t
*
source
,
exec_type_t
exec_type
,
jsexcept_t
*
ei
,
VARIANT
*
retv
)
{
script_ctx_t
*
script
=
parser
->
script
;
function_declaration_t
*
func
;
...
...
@@ -493,7 +494,7 @@ HRESULT exec_source(exec_ctx_t *ctx, parser_ctx_t *parser, source_elements_t *so
return
hres
;
}
if
(
retv
)
if
(
retv
&&
(
exec_type
==
EXECT_EVAL
||
rt
.
type
==
RT_RETURN
)
)
*
retv
=
val
;
else
VariantClear
(
&
val
);
...
...
dlls/jscript/engine.h
View file @
56b04194
...
...
@@ -109,9 +109,15 @@ static inline void exec_addref(exec_ctx_t *ctx)
ctx
->
ref
++
;
}
typedef
enum
{
EXECT_PROGRAM
,
EXECT_FUNCTION
,
EXECT_EVAL
}
exec_type_t
;
void
exec_release
(
exec_ctx_t
*
);
HRESULT
create_exec_ctx
(
script_ctx_t
*
,
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
*
,
exec_type_t
,
jsexcept_t
*
,
VARIANT
*
);
typedef
struct
_statement_t
statement_t
;
typedef
struct
_expression_t
expression_t
;
...
...
dlls/jscript/function.c
View file @
56b04194
...
...
@@ -216,7 +216,7 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis
if
(
FAILED
(
hres
))
return
hres
;
hres
=
exec_source
(
exec_ctx
,
function
->
parser
,
function
->
source
,
ei
,
retv
);
hres
=
exec_source
(
exec_ctx
,
function
->
parser
,
function
->
source
,
EXECT_FUNCTION
,
ei
,
retv
);
exec_release
(
exec_ctx
);
return
hres
;
...
...
dlls/jscript/global.c
View file @
56b04194
...
...
@@ -408,7 +408,7 @@ static HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DIS
return
throw_syntax_error
(
ctx
,
ei
,
hres
,
NULL
);
}
hres
=
exec_source
(
ctx
->
exec_ctx
,
parser_ctx
,
parser_ctx
->
source
,
ei
,
retv
);
hres
=
exec_source
(
ctx
->
exec_ctx
,
parser_ctx
,
parser_ctx
->
source
,
EXECT_EVAL
,
ei
,
retv
);
parser_release
(
parser_ctx
);
return
hres
;
...
...
dlls/jscript/jscript.c
View file @
56b04194
...
...
@@ -104,7 +104,7 @@ static HRESULT exec_global_code(JScript *This, parser_ctx_t *parser_ctx)
IActiveScriptSite_OnEnterScript
(
This
->
site
);
memset
(
&
jsexcept
,
0
,
sizeof
(
jsexcept
));
hres
=
exec_source
(
exec_ctx
,
parser_ctx
,
parser_ctx
->
source
,
&
jsexcept
,
&
var
);
hres
=
exec_source
(
exec_ctx
,
parser_ctx
,
parser_ctx
->
source
,
EXECT_PROGRAM
,
&
jsexcept
,
&
var
);
VariantClear
(
&
jsexcept
.
var
);
exec_release
(
exec_ctx
);
if
(
SUCCEEDED
(
hres
))
...
...
dlls/jscript/tests/lang.js
View file @
56b04194
...
...
@@ -109,6 +109,11 @@ ok(typeof(this) === "object", "typeof(this) is not object");
ok
(
testFunc1
(
true
,
"test"
)
===
true
,
"testFunc1 not returned true"
);
tmp
=
(
function
()
{
1
;})();
ok
(
tmp
===
undefined
,
"tmp = "
+
tmp
);
tmp
=
eval
(
"1;"
);
ok
(
tmp
===
1
,
"tmp = "
+
tmp
);
var
obj1
=
new
Object
();
ok
(
typeof
(
obj1
)
===
"object"
,
"typeof(obj1) is not object"
);
obj1
.
test
=
true
;
...
...
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