mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Javascript: Convert void and undefined vars to correct QuickJS values
This commit is contained in:
parent
ced6347505
commit
9844687735
1 changed files with 7 additions and 1 deletions
|
|
@ -83,6 +83,12 @@ static qjs::JSValue juceToQuickJs (const var& v, qjs::JSContext* ctx)
|
|||
{
|
||||
using namespace qjs;
|
||||
|
||||
if (v.isVoid())
|
||||
return JS_NULL;
|
||||
|
||||
if (v.isUndefined())
|
||||
return JS_UNDEFINED;
|
||||
|
||||
if (v.isInt())
|
||||
return JS_NewInt32 (ctx, static_cast<int> (v));
|
||||
|
||||
|
|
@ -180,7 +186,7 @@ static qjs::JSValue juceToQuickJs (const var& v, qjs::JSContext* ctx)
|
|||
return result;
|
||||
}
|
||||
|
||||
jassert (v.isVoid());
|
||||
jassertfalse;
|
||||
return JS_UNDEFINED;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue