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
d8e841ca
Commit
d8e841ca
authored
Jul 22, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Throw 'undefined object' error.
parent
d6176429
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
8 deletions
+10
-8
engine.c
dlls/jscript/engine.c
+4
-5
error.c
dlls/jscript/error.c
+3
-3
jscript_En.rc
dlls/jscript/jscript_En.rc
+1
-0
resource.h
dlls/jscript/resource.h
+1
-0
api.js
dlls/jscript/tests/api.js
+1
-0
No files found.
dlls/jscript/engine.c
View file @
d8e841ca
...
...
@@ -433,7 +433,7 @@ HRESULT exec_source(exec_ctx_t *ctx, parser_ctx_t *parser, source_elements_t *so
}
/* ECMA-262 3rd Edition 10.1.4 */
static
HRESULT
identifier_eval
(
exec_ctx_t
*
ctx
,
BSTR
identifier
,
DWORD
flags
,
exprval_t
*
ret
)
static
HRESULT
identifier_eval
(
exec_ctx_t
*
ctx
,
BSTR
identifier
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
{
scope_chain_t
*
scope
;
named_item_t
*
item
;
...
...
@@ -518,8 +518,7 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, ex
return
S_OK
;
}
WARN
(
"Could not find identifier %s
\n
"
,
debugstr_w
(
identifier
));
return
E_FAIL
;
return
throw_type_error
(
ctx
->
var_disp
->
ctx
,
ei
,
IDS_UNDEFINED
,
identifier
);
}
/* ECMA-262 3rd Edition 12.1 */
...
...
@@ -855,7 +854,7 @@ HRESULT forin_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t
TRACE
(
"iter %s
\n
"
,
debugstr_w
(
str
));
if
(
stat
->
variable
)
hres
=
identifier_eval
(
ctx
,
identifier
,
0
,
&
exprval
);
hres
=
identifier_eval
(
ctx
,
identifier
,
0
,
NULL
,
&
exprval
);
else
hres
=
expr_eval
(
ctx
,
stat
->
expr
,
EXPR_NEWREF
,
&
rt
->
ei
,
&
exprval
);
if
(
SUCCEEDED
(
hres
))
{
...
...
@@ -1596,7 +1595,7 @@ HRESULT identifier_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD f
if
(
!
identifier
)
return
E_OUTOFMEMORY
;
hres
=
identifier_eval
(
ctx
,
identifier
,
flags
,
ret
);
hres
=
identifier_eval
(
ctx
,
identifier
,
flags
,
ei
,
ret
);
SysFreeString
(
identifier
);
return
hres
;
...
...
dlls/jscript/error.c
View file @
d8e841ca
...
...
@@ -415,17 +415,17 @@ static HRESULT throw_error(script_ctx_t *ctx, jsexcept_t *ei, UINT id, const WCH
DispatchEx
*
err
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
LoadStringW
(
jscript_hinstance
,
id
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
));
if
(
str
)
pos
=
strchrW
(
buf
,
'|'
);
if
(
pos
)
{
int
len
=
strlenW
(
str
);
memmove
(
pos
+
len
,
pos
+
1
,
strlenW
(
pos
+
1
)
*
sizeof
(
WCHAR
));
memmove
(
pos
+
len
,
pos
+
1
,
(
strlenW
(
pos
+
1
)
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
pos
,
str
,
len
*
sizeof
(
WCHAR
));
}
WARN
(
"%s
\n
"
,
debugstr_w
(
buf
));
id
|=
0x800A0000
;
hres
=
create_error
(
ctx
,
constr
,
&
id
,
buf
,
&
err
);
if
(
FAILED
(
hres
))
...
...
dlls/jscript/jscript_En.rc
View file @
d8e841ca
...
...
@@ -27,6 +27,7 @@ STRINGTABLE DISCARDABLE
IDS_ARG_NOT_OPT "Argument not optional"
IDS_NOT_DATE "'[object]' is not a date object"
IDS_NOT_NUM "Number expected"
IDS_UNDEFINED "'|' is undefined"
IDS_NOT_BOOL "Boolean object expected"
IDS_INVALID_LENGTH "Array length must be a finite positive integer"
}
dlls/jscript/resource.h
View file @
d8e841ca
...
...
@@ -23,5 +23,6 @@
#define IDS_ARG_NOT_OPT 0x01c1
#define IDS_NOT_DATE 0x138E
#define IDS_NOT_NUM 0x1389
#define IDS_UNDEFINED 0x1391
#define IDS_NOT_BOOL 0x1392
#define IDS_INVALID_LENGTH 0x13A5
dlls/jscript/tests/api.js
View file @
d8e841ca
...
...
@@ -1313,5 +1313,6 @@ exception_test(function() {date.setTime();}, "TypeError", -2146827839);
exception_test
(
function
()
{
arr
.
test
();},
"TypeError"
,
-
2146827850
);
exception_test
(
function
()
{
arr
.
toString
=
Number
.
prototype
.
toString
;
arr
.
toString
();},
"TypeError"
,
-
2146823287
);
exception_test
(
function
()
{(
new
Number
(
3
)).
toString
(
1
);},
"TypeError"
,
-
2146828283
);
exception_test
(
function
()
{
not_existing_variable
.
something
();},
"TypeError"
,
-
2146823279
);
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