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
2d71dac4
Commit
2d71dac4
authored
Jul 20, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Add Error_toString implementation.
parent
f17b1f63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
error.c
dlls/jscript/error.c
+13
-2
api.js
dlls/jscript/tests/api.js
+10
-0
No files found.
dlls/jscript/error.c
View file @
2d71dac4
...
...
@@ -54,11 +54,22 @@ static HRESULT Error_message(DispatchEx *dispex, LCID lcid, WORD flags,
}
}
/* ECMA-262 3rd Edition 15.11.4.4 */
static
HRESULT
Error_toString
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
static
const
WCHAR
str
[]
=
{
'['
,
'o'
,
'b'
,
'j'
,
'e'
,
'c'
,
't'
,
' '
,
'E'
,
'r'
,
'r'
,
'o'
,
'r'
,
']'
,
0
};
TRACE
(
"
\n
"
);
if
(
retv
)
{
V_VT
(
retv
)
=
VT_BSTR
;
V_BSTR
(
retv
)
=
SysAllocString
(
str
);
if
(
!
V_BSTR
(
retv
))
return
E_OUTOFMEMORY
;
}
return
S_OK
;
}
static
HRESULT
Error_hasOwnProperty
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
...
...
dlls/jscript/tests/api.js
View file @
2d71dac4
...
...
@@ -1253,6 +1253,8 @@ ok(err.valueOf === Object.prototype.valueOf, "err.valueOf !== Object.prototype.v
ok
(
Error
.
prototype
.
name
===
"Error"
,
"Error.prototype.name = "
+
Error
.
prototype
.
name
);
ok
(
err
.
name
===
"Error"
,
"err.name = "
+
err
.
name
);
EvalError
.
prototype
.
message
=
"test"
;
ok
(
err
.
toString
!==
Object
.
prototype
.
toString
,
"err.toString === Object.prototype.toString"
);
ok
(
err
.
toString
()
===
"[object Error]"
,
"err.toString() = "
+
err
.
toString
());
err
=
new
EvalError
();
ok
(
EvalError
.
prototype
.
name
===
"EvalError"
,
"EvalError.prototype.name = "
+
EvalError
.
prototype
.
name
);
ok
(
err
.
name
===
"EvalError"
,
"err.name = "
+
err
.
name
);
...
...
@@ -1260,22 +1262,30 @@ ok(err.toString === Error.prototype.toString, "err.toString !== Error.prototype.
ok
(
err
.
message
===
""
,
"err.message != ''"
);
err
.
message
=
date
;
ok
(
err
.
message
===
date
,
"err.message != date"
);
ok
(
err
.
toString
()
===
"[object Error]"
,
"err.toString() = "
+
err
.
toString
());
ok
(
err
.
toString
!==
Object
.
prototype
.
toString
,
"err.toString === Object.prototype.toString"
);
err
=
new
RangeError
();
ok
(
RangeError
.
prototype
.
name
===
"RangeError"
,
"RangeError.prototype.name = "
+
RangeError
.
prototype
.
name
);
ok
(
err
.
name
===
"RangeError"
,
"err.name = "
+
err
.
name
);
ok
(
err
.
toString
()
===
"[object Error]"
,
"err.toString() = "
+
err
.
toString
());
err
=
new
ReferenceError
();
ok
(
ReferenceError
.
prototype
.
name
===
"ReferenceError"
,
"ReferenceError.prototype.name = "
+
ReferenceError
.
prototype
.
name
);
ok
(
err
.
name
===
"ReferenceError"
,
"err.name = "
+
err
.
name
);
ok
(
err
.
toString
()
===
"[object Error]"
,
"err.toString() = "
+
err
.
toString
());
err
=
new
SyntaxError
();
ok
(
SyntaxError
.
prototype
.
name
===
"SyntaxError"
,
"SyntaxError.prototype.name = "
+
SyntaxError
.
prototype
.
name
);
ok
(
err
.
name
===
"SyntaxError"
,
"err.name = "
+
err
.
name
);
ok
(
err
.
toString
()
===
"[object Error]"
,
"err.toString() = "
+
err
.
toString
());
err
=
new
TypeError
();
ok
(
TypeError
.
prototype
.
name
===
"TypeError"
,
"TypeError.prototype.name = "
+
TypeError
.
prototype
.
name
);
ok
(
err
.
name
===
"TypeError"
,
"err.name = "
+
err
.
name
);
ok
(
err
.
toString
()
===
"[object Error]"
,
"err.toString() = "
+
err
.
toString
());
err
=
new
URIError
();
ok
(
URIError
.
prototype
.
name
===
"URIError"
,
"URIError.prototype.name = "
+
URIError
.
prototype
.
name
);
ok
(
err
.
name
===
"URIError"
,
"err.name = "
+
err
.
name
);
ok
(
err
.
toString
()
===
"[object Error]"
,
"err.toString() = "
+
err
.
toString
());
err
=
new
Error
(
"message"
);
ok
(
err
.
message
===
"message"
,
"err.message !== 'message'"
);
ok
(
err
.
toString
()
===
"[object Error]"
,
"err.toString() = "
+
err
.
toString
());
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