A tool in jerry-ext: arg transformer for binding (#1740)
It provides some APIs for binding developers, so that they can validate the type of the js argument and convert/assign them to the native argument. Related Issue: #1716 JerryScript-DCO-1.0-Signed-off-by: Martijn The martijn.the@intel.com JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
This commit is contained in:
@@ -74,6 +74,8 @@ def get_arguments():
|
||||
help='enable the jerry debugger (%(choices)s; default: %(default)s)')
|
||||
parser.add_argument('--jerry-debugger-port', metavar='N', action='store', type=int, default=5001,
|
||||
help='add custom port number (default: %(default)s)')
|
||||
parser.add_argument('--jerry-ext', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
|
||||
help='build jerry-ext (default: %(default)s)')
|
||||
parser.add_argument('--jerry-libc', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
|
||||
help='build and use jerry-libc (%(choices)s; default: %(default)s)')
|
||||
parser.add_argument('--jerry-libm', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper,
|
||||
@@ -147,6 +149,7 @@ def generate_build_options(arguments):
|
||||
build_options.append('-DJERRY_CMDLINE=%s' % arguments.jerry_cmdline)
|
||||
build_options.append('-DJERRY_CMDLINE_MINIMAL=%s' % arguments.jerry_cmdline_minimal)
|
||||
build_options.append('-DJERRY_PORT_DEFAULT=%s' % arguments.jerry_port_default)
|
||||
build_options.append('-DJERRY_EXT=%s' % arguments.jerry_ext)
|
||||
build_options.append('-DJERRY_LIBC=%s' % arguments.jerry_libc)
|
||||
build_options.append('-DJERRY_LIBM=%s' % arguments.jerry_libm)
|
||||
build_options.append('-DFEATURE_JS_PARSER=%s' % arguments.js_parser)
|
||||
|
||||
@@ -23,12 +23,14 @@ else
|
||||
fi
|
||||
|
||||
JERRY_CORE_DIRS=`find jerry-core -type d`
|
||||
JERRY_EXT_DIRS=`find jerry-ext -type d`
|
||||
JERRY_PORT_DIRS=`find jerry-port -type d`
|
||||
JERRY_LIBC_DIRS=`find jerry-libc -type d`
|
||||
JERRY_LIBM_DIRS=`find jerry-libm -type d`
|
||||
|
||||
|
||||
INCLUDE_DIRS=()
|
||||
for DIR in $JERRY_CORE_DIRS $JERRY_PORT_DIRS $JERRY_LIBC_DIRS $JERRY_LIBM_DIRS
|
||||
for DIR in $JERRY_CORE_DIRS $JERRY_EXT_DIRS $JERRY_PORT_DIRS $JERRY_LIBC_DIRS $JERRY_LIBM_DIRS
|
||||
do
|
||||
INCLUDE_DIRS=("${INCLUDE_DIRS[@]}" "-I$DIR")
|
||||
done
|
||||
@@ -41,4 +43,4 @@ cppcheck -j$CPPCHECK_JOBS --force \
|
||||
--exitcode-suppressions=tools/cppcheck/suppressions-list \
|
||||
--suppressions-list=tools/cppcheck/suppressions-list \
|
||||
"${INCLUDE_DIRS[@]}" \
|
||||
jerry-core jerry-port jerry-libc jerry-libm jerry-main tests/unit-*
|
||||
jerry-core jerry-ext jerry-port jerry-libc jerry-libm jerry-main tests/unit-*
|
||||
|
||||
@@ -40,6 +40,7 @@ LICENSE = re.compile(
|
||||
INCLUDE_DIRS = [
|
||||
'cmake',
|
||||
'jerry-core',
|
||||
'jerry-ext',
|
||||
'jerry-libc',
|
||||
'jerry-libm',
|
||||
'jerry-main',
|
||||
|
||||
+2
-1
@@ -15,6 +15,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
JERRY_CORE_FILES=`find ./jerry-core -name "*.c" -or -name "*.h"`
|
||||
JERRY_EXT_FILES=`find ./jerry-ext -name "*.c" -or -name "*.h"`
|
||||
JERRY_PORT_FILES=`find ./jerry-port -name "*.c" -or -name "*.h"`
|
||||
JERRY_LIBC_FILES=`find ./jerry-libc -name "*.c" -or -name "*.h"`
|
||||
JERRY_LIBM_FILES=`find ./jerry-libm -name "*.c" -or -name "*.h"`
|
||||
@@ -28,4 +29,4 @@ fi
|
||||
|
||||
vera++ -r tools/vera++ -p jerry \
|
||||
-e --no-duplicate \
|
||||
$MANUAL_CHECK_FILES $JERRY_CORE_FILES $JERRY_PORT_FILES $JERRY_LIBC_FILES $JERRY_LIBM_FILES $JERRY_MAIN_FILES $UNIT_TEST_FILES
|
||||
$MANUAL_CHECK_FILES $JERRY_CORE_FILES $JERRY_EXT_FILES $JERRY_PORT_FILES $JERRY_LIBC_FILES $JERRY_LIBM_FILES $JERRY_MAIN_FILES $UNIT_TEST_FILES
|
||||
|
||||
@@ -2,3 +2,4 @@ wrongmathcall:tests/unit-libm/test-libm.inc.h
|
||||
variableScope:jerry-libm/*.c
|
||||
invalidPointerCast:jerry-libm/*.c
|
||||
arithOperationsOnVoidPointer:jerry-libc/*.c
|
||||
commaSeparatedReturn:jerry-ext/include/jerryscript-ext/arg.impl.h
|
||||
|
||||
Reference in New Issue
Block a user