From: Pawel Kaczmarek
Date: Wed, 28 Jan 2015 12:42:18 +0000 (+0100)
Subject: [Tool][Generator] Add validation to constructor function in JS and remove native...
X-Git-Tag: submit/tizen_tv/20150603.064601~1^2~541^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5bfe18cb72e61bd4dae6709762eea9da352ded2c;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Tool][Generator] Add validation to constructor function in JS and remove native call
[Verification]
Each constructor in JS should have validation
Should not generate native call in JS and c++
Change-Id: If4895868b5e61a4c4155edc746a7e7cec8c9208d
Signed-off-by: Pawel Kaczmarek
---
diff --git a/tools/skeleton_generator/WAPIOven.py b/tools/skeleton_generator/WAPIOven.py
index 3c204dc9..31c4f52b 100644
--- a/tools/skeleton_generator/WAPIOven.py
+++ b/tools/skeleton_generator/WAPIOven.py
@@ -173,12 +173,6 @@ class Compiler(IndentPrintable):
if child.name == attr.name:
attr.existIn = x.name + "." + child.name
break
- if len([x for x in attributes if not hasattr(x, "existIn")]) > 0:
- native_function = iface.name + "Constructor"
- native_cmd = iface.name + "_constructor"
- self.ctx['cmdtable'][native_function] = native_cmd
- iface.native_function = native_function
- iface.native_cmd = native_cmd
if iface.inherit in [x.name for x in self.ctx['exportedInterface']]:
iface.private = True
#if iface.name in self.ctx['callback']:
diff --git a/tools/skeleton_generator/tpl/tpl_api.js b/tools/skeleton_generator/tpl/tpl_api.js
index e75425c1..88de9529 100644
--- a/tools/skeleton_generator/tpl/tpl_api.js
+++ b/tools/skeleton_generator/tpl/tpl_api.js
@@ -86,15 +86,7 @@ function {{iface.name}}(
{%- endfor -%}
{%- endif -%}) {
// constructor of {{iface.name}}
- {% if iface.constructor %}
- var nativeParam = {
- {% for arg in iface.constructor.primitiveArgs %}
- '{{arg.name}}': args.{{arg.name}}{% if not loop.last %},{% endif %}
-
- {% endfor %}
- };
- var syncResult = callNative('{{iface.name}}_constructor', nativeParam);
- {% endif %}
+ validator_.isConstructorCall(this, {{iface.name}});
{% for attribute in iface.getTypes('Attribute') %}
{% if attribute.existIn == 'ctor' %}