Skip to content

Commit

Permalink
Merge pull request #238 from rollbar/add-explicit-semicolon-to-js-helper
Browse files Browse the repository at this point in the history
add an explicit semicolon between snippet and custom js
  • Loading branch information
rokob committed Jul 28, 2017
2 parents bed9404 + babf010 commit d4dccaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/RollbarJsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function buildJs(
public function addJs($headers = null, $nonce = null, $customJs = "")
{
return $this->scriptTag(
$this->configJsTag() .$this->jsSnippet() . $customJs,
$this->configJsTag() . $this->jsSnippet() . ";" . $customJs,
$headers,
$nonce
);
Expand Down
6 changes: 3 additions & 3 deletions tests/RollbarJsHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public function addJsProvider()
null, // 'nonce'
"\n<script type=\"text/javascript\">" .
"var _rollbarConfig = {};" .
$expectedJs .
$expectedJs . ";" .
"var customJs = true;" .
"</script>"
),
Expand All @@ -295,7 +295,7 @@ public function addJsProvider()
null,
"\n<script type=\"text/javascript\">" .
"var _rollbarConfig = {\"foo\":\"bar\"};" .
$expectedJs .
$expectedJs . ";" .
"var customJs = true;" .
"</script>"
),
Expand All @@ -307,7 +307,7 @@ public function addJsProvider()
'stub-nonce',
"\n<script type=\"text/javascript\" nonce=\"stub-nonce\">" .
"var _rollbarConfig = {};" .
$expectedJs .
$expectedJs . ";" .
"var customJs = true;" .
"</script>"
),
Expand Down

0 comments on commit d4dccaf

Please sign in to comment.