@@ -372,6 +372,33 @@ static PHP_METHOD(ObjectTemplate, setCallAsFunctionHandler) {
372
372
local_template->SetCallAsFunctionHandler (callback, data);
373
373
}
374
374
375
+ static PHP_METHOD (ObjectTemplate, isImmutableProto) {
376
+ if (zend_parse_parameters_none () == FAILURE) {
377
+ return ;
378
+ }
379
+
380
+ PHP_V8_FETCH_OBJECT_TEMPLATE_WITH_CHECK (getThis (), php_v8_object_template);
381
+ PHP_V8_ENTER_STORED_ISOLATE (php_v8_object_template);
382
+
383
+ v8::Local<v8::ObjectTemplate> local_obj_tpl = php_v8_object_template_get_local (php_v8_object_template);
384
+
385
+ RETURN_BOOL (static_cast <zend_bool>(local_obj_tpl->IsImmutableProto ()));
386
+ }
387
+
388
+ static PHP_METHOD (ObjectTemplate, setImmutableProto) {
389
+ if (zend_parse_parameters_none () == FAILURE) {
390
+ return ;
391
+ }
392
+
393
+ PHP_V8_FETCH_OBJECT_TEMPLATE_WITH_CHECK (getThis (), php_v8_object_template);
394
+ PHP_V8_ENTER_STORED_ISOLATE (php_v8_object_template);
395
+
396
+ v8::Local<v8::ObjectTemplate> local_obj_tpl = php_v8_object_template_get_local (php_v8_object_template);
397
+
398
+ local_obj_tpl->SetImmutableProto ();
399
+ }
400
+
401
+
375
402
/* Non-standard, implementations of AdjustableExternalMemoryInterface::AdjustExternalAllocatedMemory */
376
403
static PHP_METHOD (ObjectTemplate, adjustExternalAllocatedMemory) {
377
404
php_v8_ext_mem_interface_object_template_AdjustExternalAllocatedMemory (INTERNAL_FUNCTION_PARAM_PASSTHRU);
@@ -443,6 +470,12 @@ PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_VOID_INFO_EX(arginfo_setCallAsFunctionHandler,
443
470
ZEND_ARG_INFO(0 , callback)
444
471
ZEND_END_ARG_INFO()
445
472
473
+ PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isImmutableProto, ZEND_RETURN_VALUE, 0 , _IS_BOOL, 0 )
474
+ ZEND_END_ARG_INFO()
475
+
476
+ PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_VOID_INFO_EX(arginfo_setImmutableProto, 0 )
477
+ ZEND_END_ARG_INFO()
478
+
446
479
PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1 , IS_LONG, 0 )
447
480
ZEND_ARG_TYPE_INFO(0 , change_in_bytes, IS_LONG, 0 )
448
481
ZEND_END_ARG_INFO()
@@ -453,18 +486,20 @@ ZEND_END_ARG_INFO()
453
486
454
487
455
488
static const zend_function_entry php_v8_object_template_methods[] = {
456
- PHP_V8_ME (ObjectTemplate, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
457
- PHP_V8_ME (ObjectTemplate, getIsolate, ZEND_ACC_PUBLIC)
458
- PHP_V8_ME (ObjectTemplate, set, ZEND_ACC_PUBLIC)
459
- PHP_V8_ME (ObjectTemplate, setAccessorProperty, ZEND_ACC_PUBLIC)
460
- PHP_V8_ME (ObjectTemplate, setNativeDataProperty, ZEND_ACC_PUBLIC)
461
- PHP_V8_ME (ObjectTemplate, newInstance, ZEND_ACC_PUBLIC)
462
- PHP_V8_ME (ObjectTemplate, setAccessor, ZEND_ACC_PUBLIC)
463
- PHP_V8_ME (ObjectTemplate, setHandlerForNamedProperty, ZEND_ACC_PUBLIC)
464
- PHP_V8_ME (ObjectTemplate, setHandlerForIndexedProperty, ZEND_ACC_PUBLIC)
465
- PHP_V8_ME (ObjectTemplate, setCallAsFunctionHandler, ZEND_ACC_PUBLIC)
466
- PHP_V8_ME (ObjectTemplate, adjustExternalAllocatedMemory, ZEND_ACC_PUBLIC)
467
- PHP_V8_ME (ObjectTemplate, getExternalAllocatedMemory, ZEND_ACC_PUBLIC)
489
+ PHP_V8_ME (ObjectTemplate, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
490
+ PHP_V8_ME (ObjectTemplate, getIsolate, ZEND_ACC_PUBLIC)
491
+ PHP_V8_ME (ObjectTemplate, set, ZEND_ACC_PUBLIC)
492
+ PHP_V8_ME (ObjectTemplate, setAccessorProperty, ZEND_ACC_PUBLIC)
493
+ PHP_V8_ME (ObjectTemplate, setNativeDataProperty, ZEND_ACC_PUBLIC)
494
+ PHP_V8_ME (ObjectTemplate, newInstance, ZEND_ACC_PUBLIC)
495
+ PHP_V8_ME (ObjectTemplate, setAccessor, ZEND_ACC_PUBLIC)
496
+ PHP_V8_ME (ObjectTemplate, setHandlerForNamedProperty, ZEND_ACC_PUBLIC)
497
+ PHP_V8_ME (ObjectTemplate, setHandlerForIndexedProperty, ZEND_ACC_PUBLIC)
498
+ PHP_V8_ME (ObjectTemplate, setCallAsFunctionHandler, ZEND_ACC_PUBLIC)
499
+ PHP_V8_ME (ObjectTemplate, isImmutableProto, ZEND_ACC_PUBLIC)
500
+ PHP_V8_ME (ObjectTemplate, setImmutableProto, ZEND_ACC_PUBLIC)
501
+ PHP_V8_ME (ObjectTemplate, adjustExternalAllocatedMemory, ZEND_ACC_PUBLIC)
502
+ PHP_V8_ME (ObjectTemplate, getExternalAllocatedMemory, ZEND_ACC_PUBLIC)
468
503
469
504
PHP_FE_END
470
505
};
0 commit comments