8000 Refactoring · reactjs/react-php-v8js@882f81d · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit 882f81d

Browse files
committed
Refactoring
1 parent d7a9c34 commit 882f81d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ReactJS.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ function getMarkup() {
104104
$this->component,
105105
$this->data);
106106

107-
ob_start();
108-
$this->executeJS($js);
109-
return ob_get_clean();
107+
return $this->executeJS($js);
110108
}
111109

112110
/**
@@ -150,11 +148,13 @@ function getJS($where, $return_var = null) {
150148
* Executes Javascript using V8JS, with primitive exception handling
151149
*
152150
* @param string $js JS code to be executed
153-
* @return mixed
151+
* @return string The execution response
154152
*/
155153
private function executeJS($js) {
156154
try {
157-
return $this->v8->executeString($js);
155+
ob_start();
156+
$this->v8->executeString($js);
157+
return ob_get_clean();
158158
} catch (V8JsException $e) {
159159
if ($this->errorHandler) {
160160
call_user_func($this->errorHandler, $e);

0 commit comments

Comments
 (0)
0