Commit 9f19aa8
Fix "PHP Warning: Undefined array key currentUri" when using
When enabling source maps and an input file uses `@import (inline)`,
then the source map generation causes this error because not all
chunks have file info metadata associated in that case.
This matches upstream behaviour at
* Output Mapped:
https://github.com/less/less.js/blob/v3.13.1/packages/less/src/less/source-map-output.js#L89
* Generator:
https://github.com/mozilla/source-map/blob/v0.7.4/lib/source-map-generator.js#L110-L129
Without the changes in lib/, the new test case fails with:
```
1) MapTest::testImportInline
Undefined array key "currentUri"
/less.php/lib/Less/Output/Mapped.php:68
…
/less.php/lib/Less/SourceMap/Generator.php:118
/less.php/lib/Less/Parser.php:235
/less.php/test/phpunit/MapTest.php:37
```
Ref #109.
Closes https://github.com/wikimedia/less.php/pull/121.
Bug: T380641
Change-Id: I2e04e33facd6f900c147c124e9931ffc2cac5551@import (inline)
1 parent d9c2671 commit 9f19aa8
File tree
6 files changed
+36
-11
lines changed- lib/Less
- Output
- SourceMap
- test
- Fixtures/less.php
- css
- less
- phpunit
6 files changed
+36
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
| |||
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
15 | 29 | | |
16 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
17 | 36 | | |
18 | | - | |
| 37 | + | |
19 | 38 | | |
20 | 39 | | |
21 | 40 | | |
| |||
0 commit comments