phpv8 / php-v8

PHP extension for V8 JavaScript engine
https://php-v8.readthedocs.io
MIT License
217 stars 14 forks source link

Fix Template::Set() #26

Closed pinepain closed 7 years ago

pinepain commented 7 years ago

Template::Set() property to set must be defined either as a primitive value, or a template. Before that property value was filtered only by argument type (V8\Data) which also let objects in, which caused segfault/abort from v8 internals.

During the fix it came up that V8\Value was used as a replacement for javascript undefined value, however, from ECMA and V8 perspective it's not correct as undefened should be primitive and objects should not. So whole values inheritance chain had to be fixed: now V8\Value, V8\PrimitiveValue and V8\NameValue are declared as abstract and MUST NOT be instantiated in userland and their usage should be type hinting and type checking only.

Changes list that affect API: