Skip to content

Commit

Permalink
fix(runtime): array.prototype.slice result error
Browse files Browse the repository at this point in the history
  • Loading branch information
cxtom committed May 30, 2019
1 parent 86ccb95 commit 43b40c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/Ts2Php_Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ static public function padStart($input, $pad_length, $pad_string = " "){
* @return {string}
*/
static public function arraySlice($origin, $start, $end) {
return array_slice($origin, $start, $end - $start + 1);
$end = isset($end) ? $end : count($origin);
return array_slice($origin, $start, $end - $start);
}

/**
Expand Down

0 comments on commit 43b40c0

Please sign in to comment.