MDL-75476 scssphp: Updated from 1.10.0 to 1.11.0
This commit is contained in:
@@ -107,7 +107,7 @@ class SourceMapGenerator
|
||||
*/
|
||||
public function __construct(array $options = [])
|
||||
{
|
||||
$this->options = array_merge($this->defaultOptions, $options);
|
||||
$this->options = array_replace($this->defaultOptions, $options);
|
||||
$this->encoder = new Base64VLQ();
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ class SourceMapGenerator
|
||||
*
|
||||
* @param string $content The content to write
|
||||
*
|
||||
* @return string
|
||||
* @return string|null
|
||||
*
|
||||
* @throws \ScssPhp\ScssPhp\Exception\CompilerException If the file could not be saved
|
||||
* @deprecated
|
||||
@@ -148,6 +148,7 @@ class SourceMapGenerator
|
||||
public function saveMap($content)
|
||||
{
|
||||
$file = $this->options['sourceMapWriteTo'];
|
||||
assert($file !== null);
|
||||
$dir = \dirname($file);
|
||||
|
||||
// directory does not exist
|
||||
@@ -201,7 +202,7 @@ class SourceMapGenerator
|
||||
// A list of original sources used by the 'mappings' entry.
|
||||
$sourceMap['sources'] = [];
|
||||
|
||||
foreach ($this->sources as $sourceUri => $sourceFilename) {
|
||||
foreach ($this->sources as $sourceFilename) {
|
||||
$sourceMap['sources'][] = $this->normalizeFilename($sourceFilename);
|
||||
}
|
||||
|
||||
@@ -223,7 +224,15 @@ class SourceMapGenerator
|
||||
unset($sourceMap['sourceRoot']);
|
||||
}
|
||||
|
||||
return json_encode($sourceMap, JSON_UNESCAPED_SLASHES);
|
||||
$jsonSourceMap = json_encode($sourceMap, JSON_UNESCAPED_SLASHES);
|
||||
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
throw new \RuntimeException(json_last_error_msg());
|
||||
}
|
||||
|
||||
assert($jsonSourceMap !== false);
|
||||
|
||||
return $jsonSourceMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user