Vector of unions for TS/JS and PHP (#4404)

* Eclipse ignore

* TypeScript support

* Prefixing enums

* Test results

* Merged JS and TS generators

* Fixed AppVeyor build problems

* Fixed more AppVeyor build problems

* Fixed more AppVeyor build problems

* Changed TS flag to options struct

* Storing options by value

* Removed unneeded const

* Re-export support for unions

* Uint support

* Casting bools to numbers for mutation

* TS shell tests

* Reverted generates js test file to original version

* Backing up js tests and properly generating test data

* Not importing flatbuffers for TS test generation

* Not overwriting generated js for tests

* AppVeyor test fixes

* Generating the most strict TS code possible

* Not returning null when creating vectors

* Not returning null from struct contructors

* Vector of unions for ts/js

* Sanity check for languages

* Indentation fix + output test files

* Vectors of unions for php

* Fixes to union vector handling + tests
This commit is contained in:
Kamil Rojewski
2017-08-11 18:24:36 +02:00
committed by Wouter van Oortmerssen
parent 7cc72e4b11
commit 46bb05d952
20 changed files with 1608 additions and 27 deletions

View File

@@ -28,4 +28,14 @@ abstract class Struct
* @var ByteBuffer $bb
*/
protected $bb;
public function setByteBufferPos($pos)
{
$this->bb_pos = $pos;
}
public function setByteBuffer($bb)
{
$this->bb = $bb;
}
}

View File

@@ -32,6 +32,16 @@ abstract class Table
{
}
public function setByteBufferPos($pos)
{
$this->bb_pos = $pos;
}
public function setByteBuffer($bb)
{
$this->bb = $bb;
}
/**
* returns actual vtable offset
*
@@ -107,8 +117,8 @@ abstract class Table
protected function __union($table, $offset)
{
$offset += $this->bb_pos;
$table->bb_pos = $offset + $this->bb->getInt($offset);
$table->bb = $this->bb;
$table->setByteBufferPos($offset + $this->bb->getInt($offset));
$table->setByteBuffer($this->bb);
return $table;
}