Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/JS.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ public function execute($path = null)
*/
protected function stripComments()
{
// enable removal of /*DEV*/ style comments
// this pattern will replace from "/*DEV*/" to end of line - e.g. "/*DEV*/ console.log(data);" -> ""
// it needs to come before the call to stripMultilineComments, otherwise that deletes
// the crucial /*DEV*/, while leaving the rest of the line entact
$this->registerPattern('/\/\*DEV\*\/.*$/m', '');

$this->stripMultilineComments();

// single-line comments
Expand Down