mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 07:01:52 +00:00
Merge pull request #435 from timothympace/api_updates
Remove deprecated Context versions of ToBoolean and BooleanValue
This commit is contained in:
commit
801c744885
@ -212,12 +212,8 @@ int v8js_to_zval(v8::Local<v8::Value> jsValue, zval *return_value, int flags, v8
|
||||
}
|
||||
else if (jsValue->IsBoolean())
|
||||
{
|
||||
v8::Maybe<bool> value = jsValue->BooleanValue(v8_context);
|
||||
if (value.IsNothing())
|
||||
{
|
||||
return FAILURE;
|
||||
}
|
||||
RETVAL_BOOL(value.ToChecked());
|
||||
bool value = jsValue->BooleanValue(isolate);
|
||||
RETVAL_BOOL(value);
|
||||
}
|
||||
else if (jsValue->IsInt32() || jsValue->IsUint32())
|
||||
{
|
||||
|
@ -122,15 +122,8 @@ static void v8js_dumper(v8::Isolate *isolate, v8::Local<v8::Value> var, int leve
|
||||
}
|
||||
if (var->IsBoolean())
|
||||
{
|
||||
v8::Maybe<bool> value = var->BooleanValue(v8_context);
|
||||
if (value.IsNothing())
|
||||
{
|
||||
php_printf("<empty>\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
php_printf("bool(%s)\n", value.FromJust() ? "true" : "false");
|
||||
}
|
||||
bool value = var->BooleanValue(isolate);
|
||||
php_printf("bool(%s)\n", value ? "true" : "false");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -863,9 +863,9 @@ static void v8js_named_property_deleter(v8::Local<v8::Name> property, const v8::
|
||||
}
|
||||
|
||||
v8::Isolate *isolate = info.GetIsolate();
|
||||
v8::MaybeLocal<v8::Boolean> value = r->ToBoolean(isolate->GetEnteredContext());
|
||||
v8::Local<v8::Boolean> value = r->ToBoolean(isolate);
|
||||
if (!value.IsEmpty()) {
|
||||
info.GetReturnValue().Set(value.ToLocalChecked());
|
||||
info.GetReturnValue().Set(value);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -133,7 +133,7 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
|
||||
c->tz = strdup(tz);
|
||||
}
|
||||
else if (strcmp(c->tz, tz) != 0) {
|
||||
v8::Date::DateTimeConfigurationChangeNotification(c->isolate);
|
||||
c->isolate->DateTimeConfigurationChangeNotification();
|
||||
|
||||
free(c->tz);
|
||||
c->tz = strdup(tz);
|
||||
|
@ -98,7 +98,7 @@ static int v8js_v8object_has_property(zval *object, zval *member, int has_set_ex
|
||||
}
|
||||
|
||||
/* empty() */
|
||||
retval = jsVal->BooleanValue(v8_context).FromMaybe(false);
|
||||
retval = jsVal->BooleanValue(isolate);
|
||||
|
||||
/* for PHP compatibility, [] should also be empty */
|
||||
if (jsVal->IsArray() && retval) {
|
||||
|
Loading…
Reference in New Issue
Block a user