Merge branch 'js-fix-626'
* js-fix-626: Added check to prevent crash on illegal constructor call
This commit is contained in:
commit
30216c4fb8
1 changed files with 4 additions and 2 deletions
|
|
@ -10,9 +10,10 @@
|
||||||
%fragment("js_ctor", "templates") %{
|
%fragment("js_ctor", "templates") %{
|
||||||
static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) {
|
static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args) {
|
||||||
SWIGV8_HANDLESCOPE();
|
SWIGV8_HANDLESCOPE();
|
||||||
|
|
||||||
SWIGV8_OBJECT self = args.Holder();
|
SWIGV8_OBJECT self = args.Holder();
|
||||||
$jslocals
|
$jslocals
|
||||||
|
if(self->InternalFieldCount() < 1) SWIG_exception_fail(SWIG_ERROR, "Illegal call of constructor $jswrapper.");
|
||||||
if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper.");
|
if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper.");
|
||||||
$jscode
|
$jscode
|
||||||
|
|
||||||
|
|
@ -77,9 +78,10 @@ fail:
|
||||||
%fragment("js_overloaded_ctor", "templates") %{
|
%fragment("js_overloaded_ctor", "templates") %{
|
||||||
static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) {
|
static SwigV8ReturnValue $jswrapper(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) {
|
||||||
SWIGV8_HANDLESCOPE();
|
SWIGV8_HANDLESCOPE();
|
||||||
|
|
||||||
SWIGV8_OBJECT self = args.Holder();
|
SWIGV8_OBJECT self = args.Holder();
|
||||||
$jslocals
|
$jslocals
|
||||||
|
if(self->InternalFieldCount() < 1) SWIG_exception_fail(SWIG_ERROR, "Illegal call of constructor $jswrapper.");
|
||||||
if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper.");
|
if(args.Length() != $jsargcount) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for $jswrapper.");
|
||||||
$jscode
|
$jscode
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue