Skip to content

Commit

Permalink
remove console.log object prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
HillLiu committed Jul 22, 2022
1 parent 5d48734 commit 72ad01a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions debug_console.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function init()
{
if (!isset($this['js'])) {
$this['js'] =
'https://cdn.jsdelivr.net/npm/organism-react-ajax@0.6.13/build/dlog.min.js';
'https://cdn.jsdelivr.net/npm/organism-react-ajax@0.17.6/build/dlog.min.js';
}
if (\PMVC\exists('dispatcher', 'plug')) {
$dispatcher = \PMVC\plug('dispatcher');
Expand Down Expand Up @@ -111,12 +111,14 @@ public function dump($p, $type = null)
return;
}

$strJson = str_replace(
'\\',
'\\\\',
\PMVC\utf8JsonEncode($p, $this->_flag)
);
$strJson = 'JSON.parse(\'' . $strJson . '\')';
$strJson =
'\'' .
str_replace(
'\\',
'\u005C',
\PMVC\utf8JsonEncode($p, $this->_flag)
) .
'\'';
if (!$debug->levelToInt($type, null)) {
$this->__dump('log.show(\'' . $type . '\',[' . $strJson . '])');
} else {
Expand Down

0 comments on commit 72ad01a

Please sign in to comment.