mirror of https://github.com/sveltejs/svelte
[feat] sourcemap markup (#6427)
* sourcemap markup * sourcemap textnode * update testpull/6517/head
parent
e238903846
commit
2cec6a94bc
@ -0,0 +1,2 @@
|
||||
<h1>decoded-sourcemap</h1>
|
||||
<div>replace me</div>
|
@ -0,0 +1,34 @@
|
||||
export function test({ assert, input, js }) {
|
||||
let expected;
|
||||
|
||||
let start;
|
||||
let actual;
|
||||
|
||||
start = js.locate('insert(target, h1');
|
||||
expected = input.locate('<h1');
|
||||
actual = js.mapConsumer.originalPositionFor({
|
||||
line: start.line + 1,
|
||||
column: start.column
|
||||
});
|
||||
|
||||
assert.deepEqual(actual, {
|
||||
source: 'input.svelte',
|
||||
name: null,
|
||||
line: expected.line + 1,
|
||||
column: expected.column
|
||||
});
|
||||
|
||||
start = js.locate('insert(target, div');
|
||||
expected = input.locate('<div');
|
||||
actual = js.mapConsumer.originalPositionFor({
|
||||
line: start.line + 1,
|
||||
column: start.column
|
||||
});
|
||||
|
||||
assert.deepEqual(actual, {
|
||||
source: 'input.svelte',
|
||||
name: null,
|
||||
line: expected.line + 1,
|
||||
column: expected.column
|
||||
});
|
||||
}
|
Loading…
Reference in new issue