Extension description syntax; extension instantiation, field values and calls with arguments (except strings); example of a simple extension.
String arguments support is supposed to be added in a subsequent commit.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,6 +22,7 @@ BUILTIN (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_OBJECT_UL,
|
||||
ECMA_BUILTIN_ID__COUNT /* no prototype */,
|
||||
true,
|
||||
true,
|
||||
object_prototype)
|
||||
|
||||
/* The Object object (15.2.1) */
|
||||
@@ -30,6 +31,7 @@ BUILTIN (ECMA_BUILTIN_ID_OBJECT,
|
||||
ECMA_MAGIC_STRING_OBJECT_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
object)
|
||||
|
||||
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN
|
||||
@@ -39,6 +41,7 @@ BUILTIN (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_ARRAY_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
array_prototype)
|
||||
|
||||
/* The Array object (15.4.1) */
|
||||
@@ -47,6 +50,7 @@ BUILTIN (ECMA_BUILTIN_ID_ARRAY,
|
||||
ECMA_MAGIC_STRING_ARRAY_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
array)
|
||||
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN*/
|
||||
|
||||
@@ -57,6 +61,7 @@ BUILTIN (ECMA_BUILTIN_ID_STRING_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_STRING_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
string_prototype)
|
||||
|
||||
/* The String object (15.5.1) */
|
||||
@@ -65,6 +70,7 @@ BUILTIN (ECMA_BUILTIN_ID_STRING,
|
||||
ECMA_MAGIC_STRING_STRING_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
string)
|
||||
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */
|
||||
|
||||
@@ -75,6 +81,7 @@ BUILTIN (ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_BOOLEAN_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
boolean_prototype)
|
||||
|
||||
/* The Boolean object (15.6.1) */
|
||||
@@ -83,6 +90,7 @@ BUILTIN (ECMA_BUILTIN_ID_BOOLEAN,
|
||||
ECMA_MAGIC_STRING_BOOLEAN_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
boolean)
|
||||
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
|
||||
|
||||
@@ -93,6 +101,7 @@ BUILTIN (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_NUMBER_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
number_prototype)
|
||||
|
||||
/* The Number object (15.7.1) */
|
||||
@@ -101,6 +110,7 @@ BUILTIN (ECMA_BUILTIN_ID_NUMBER,
|
||||
ECMA_MAGIC_STRING_NUMBER_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
number)
|
||||
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */
|
||||
|
||||
@@ -110,6 +120,7 @@ BUILTIN (ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_FUNCTION_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
function_prototype)
|
||||
|
||||
/* The Function object (15.3.1) */
|
||||
@@ -118,6 +129,7 @@ BUILTIN (ECMA_BUILTIN_ID_FUNCTION,
|
||||
ECMA_MAGIC_STRING_FUNCTION_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
function)
|
||||
|
||||
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_MATH_BUILTIN
|
||||
@@ -127,6 +139,7 @@ BUILTIN (ECMA_BUILTIN_ID_MATH,
|
||||
ECMA_MAGIC_STRING_MATH_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
math)
|
||||
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_MATH_BUILTIN */
|
||||
|
||||
@@ -137,6 +150,7 @@ BUILTIN (ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
error_prototype)
|
||||
|
||||
/* The Error object (15.11.1) */
|
||||
@@ -145,6 +159,7 @@ BUILTIN (ECMA_BUILTIN_ID_ERROR,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
error)
|
||||
|
||||
/* The EvalError.prototype object (15.11.6.1) */
|
||||
@@ -153,6 +168,7 @@ BUILTIN (ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
eval_error_prototype)
|
||||
|
||||
/* The EvalError object (15.11.6.1) */
|
||||
@@ -161,6 +177,7 @@ BUILTIN (ECMA_BUILTIN_ID_EVAL_ERROR,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
eval_error)
|
||||
|
||||
/* The RangeError.prototype object (15.11.6.2) */
|
||||
@@ -169,6 +186,7 @@ BUILTIN (ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
range_error_prototype)
|
||||
|
||||
/* The RangeError object (15.11.6.2) */
|
||||
@@ -177,6 +195,7 @@ BUILTIN (ECMA_BUILTIN_ID_RANGE_ERROR,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
range_error)
|
||||
|
||||
/* The ReferenceError.prototype object (15.11.6.3) */
|
||||
@@ -185,6 +204,7 @@ BUILTIN (ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
reference_error_prototype)
|
||||
|
||||
/* The ReferenceError object (15.11.6.3) */
|
||||
@@ -193,6 +213,7 @@ BUILTIN (ECMA_BUILTIN_ID_REFERENCE_ERROR,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
reference_error)
|
||||
|
||||
/* The SyntaxError.prototype object (15.11.6.4) */
|
||||
@@ -201,6 +222,7 @@ BUILTIN (ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
syntax_error_prototype)
|
||||
|
||||
/* The SyntaxError object (15.11.6.4) */
|
||||
@@ -209,6 +231,7 @@ BUILTIN (ECMA_BUILTIN_ID_SYNTAX_ERROR,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
syntax_error)
|
||||
|
||||
/* The TypeError.prototype object (15.11.6.5) */
|
||||
@@ -217,6 +240,7 @@ BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
type_error_prototype)
|
||||
|
||||
/* The TypeError object (15.11.6.5) */
|
||||
@@ -225,6 +249,7 @@ BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
type_error)
|
||||
|
||||
/* The URIError.prototype object (15.11.6.6) */
|
||||
@@ -233,6 +258,7 @@ BUILTIN (ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
uri_error_prototype)
|
||||
|
||||
/* The URIError object (15.11.6.6) */
|
||||
@@ -241,6 +267,7 @@ BUILTIN (ECMA_BUILTIN_ID_URI_ERROR,
|
||||
ECMA_MAGIC_STRING_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE,
|
||||
true,
|
||||
true,
|
||||
uri_error)
|
||||
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */
|
||||
|
||||
@@ -250,6 +277,7 @@ BUILTIN (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER,
|
||||
ECMA_MAGIC_STRING_FUNCTION_UL,
|
||||
ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE,
|
||||
false,
|
||||
true,
|
||||
type_error_thrower)
|
||||
|
||||
#ifdef CONFIG_ECMA_COMPACT_PROFILE
|
||||
@@ -259,6 +287,7 @@ BUILTIN (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR,
|
||||
ECMA_MAGIC_STRING_COMPACT_PROFILE_ERROR_UL,
|
||||
ECMA_BUILTIN_ID_OBJECT_PROTOTYPE,
|
||||
false,
|
||||
true,
|
||||
compact_profile_error)
|
||||
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
|
||||
|
||||
@@ -268,6 +297,16 @@ BUILTIN (ECMA_BUILTIN_ID_GLOBAL,
|
||||
ECMA_MAGIC_STRING_OBJECT_UL,
|
||||
ECMA_BUILTIN_ID__COUNT /* no prototype */,
|
||||
true,
|
||||
true,
|
||||
global)
|
||||
|
||||
/* Jerry's dynamic extension proxy object */
|
||||
BUILTIN (ECMA_BUILTIN_ID_JERRY,
|
||||
ECMA_OBJECT_TYPE_GENERAL,
|
||||
ECMA_MAGIC_STRING_OBJECT_UL,
|
||||
ECMA_BUILTIN_ID__COUNT, /* no prototype */
|
||||
false,
|
||||
false,
|
||||
jerry)
|
||||
|
||||
#undef BUILTIN
|
||||
|
||||
Reference in New Issue
Block a user