Error constructor prototypes should be Function

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
Peter Gal 2015-07-22 18:14:45 +02:00 committed by Dániel Bátyai
parent f1248b9780
commit 25450d8a12
2 changed files with 9 additions and 8 deletions

View File

@ -188,7 +188,7 @@ BUILTIN (ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
/* The Error object (15.11.1) */
BUILTIN (ECMA_BUILTIN_ID_ERROR,
ECMA_OBJECT_TYPE_FUNCTION,
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
true,
true,
error)
@ -204,7 +204,7 @@ BUILTIN (ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE,
/* The EvalError object (15.11.6.1) */
BUILTIN (ECMA_BUILTIN_ID_EVAL_ERROR,
ECMA_OBJECT_TYPE_FUNCTION,
ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE,
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
true,
true,
eval_error)
@ -220,7 +220,7 @@ BUILTIN (ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE,
/* The RangeError object (15.11.6.2) */
BUILTIN (ECMA_BUILTIN_ID_RANGE_ERROR,
ECMA_OBJECT_TYPE_FUNCTION,
ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE,
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
true,
true,
range_error)
@ -236,7 +236,7 @@ BUILTIN (ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE,
/* The ReferenceError object (15.11.6.3) */
BUILTIN (ECMA_BUILTIN_ID_REFERENCE_ERROR,
ECMA_OBJECT_TYPE_FUNCTION,
ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE,
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
true,
true,
reference_error)
@ -252,7 +252,7 @@ BUILTIN (ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE,
/* The SyntaxError object (15.11.6.4) */
BUILTIN (ECMA_BUILTIN_ID_SYNTAX_ERROR,
ECMA_OBJECT_TYPE_FUNCTION,
ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE,
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
true,
true,
syntax_error)
@ -268,7 +268,7 @@ BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE,
/* The TypeError object (15.11.6.5) */
BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR,
ECMA_OBJECT_TYPE_FUNCTION,
ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE,
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
true,
true,
type_error)
@ -284,7 +284,7 @@ BUILTIN (ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE,
/* The URIError object (15.11.6.6) */
BUILTIN (ECMA_BUILTIN_ID_URI_ERROR,
ECMA_OBJECT_TYPE_FUNCTION,
ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE,
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
true,
true,
uri_error)

View File

@ -131,7 +131,7 @@ var props = {
writable: true,
},
get bar() {
throw TypeError;
throw new TypeError("foo");
return { value : 2, writable : true };
},
prop2: {
@ -149,6 +149,7 @@ try {
assert (false);
} catch (e) {
assert (e instanceof TypeError);
assert (e.message === "foo");
}
// Define get method which deletes a property