* Ordered list of JS vars to identify the start of a closure.
* @param array $inputVals
* Ordered list of input values passed into the closure.
- * @return string
+ * @return string[]
* Javascript source.
*/
public static function dedupeClosures($scripts, $localVars, $inputVals) {
* @return string
*/
public static function stripComments($script) {
- return preg_replace(":^\\s*//[^\n]+$:m", "", $script);
+ return preg_replace("#^\\s*//[^\n]*$(?:\r\n|\n)?#m", "", $script);
}
/**
*
* @param string $js
* @return mixed
+ * @throws Exception
*/
public static function decode($js) {
$js = trim($js);
*
* @param $js
* @return array
- * @throws \Exception
+ * @throws Exception
*/
public static function getRawProps($js) {
$js = trim($js);