Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Fix Template::Set() #26

Merged
merged 3 commits into from
Apr 28, 2017
Merged

Fix Template::Set() #26

merged 3 commits into from
Apr 28, 2017

Conversation

pinepain
Copy link
Member

@pinepain pinepain commented Apr 28, 2017

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:

  • * Make V8\Value, V8\PrimitiveValue and V8\NameValue abstract;
  • Introduce separate class for undefined value - V8UndefenedValue;
  • Fix V8\Tempalte::Set() to do not accept non-primitive values;

* - BC-breaking or potentially BC-breaking changes*

@pinepain pinepain merged commit a3b349e into master Apr 28, 2017
@pinepain pinepain deleted the fix-template-set branch May 3, 2017 15:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant