Merge pull request #12483 from ts-webpack/types/source-map

fix: update version number for source-map
This commit is contained in:
Yui 2016-11-10 15:35:34 -08:00 committed by GitHub
commit c00a40ce82
2 changed files with 17 additions and 4 deletions

View File

@ -1,4 +1,4 @@
// Type definitions for source-map v0.1.38
// Type definitions for source-map v0.5.6
// Project: https://github.com/mozilla/source-map
// Definitions by: Morten Houston Ludvigsen <https://github.com/MortenHoustonLudvigsen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@ -58,7 +58,7 @@ declare namespace SourceMap {
public static GENERATED_ORDER: number;
public static ORIGINAL_ORDER: number;
constructor(rawSourceMap: RawSourceMap);
constructor(rawSourceMap: RawSourceMap | string);
public computeColumnSpans(): void;
@ -115,9 +115,9 @@ declare namespace SourceMap {
relativePath?: string
): SourceNode;
public add(chunk: any): SourceNode;
public add(chunk: (string | SourceNode)[] | SourceNode | string): SourceNode;
public prepend(chunk: any): SourceNode;
public prepend(chunk: (string | SourceNode)[] | SourceNode | string): SourceNode;
public setSourceContent(sourceFile: string, sourceContent: string): void;

View File

@ -14,6 +14,15 @@ function testSourceMapConsumer() {
file: 'sdf'
});
scm = new SourceMap.SourceMapConsumer(JSON.stringify({
version: 3,
sources: ['foo', 'bar'],
names: ['foo', 'bar'],
sourcesContent: ['foo'],
mappings: 'foo',
file: 'sdf'
}));
// create with partial RawSourceMap
scm = new SourceMap.SourceMapConsumer({
version: 3,
@ -129,10 +138,14 @@ function testSourceNode() {
function testAdd(node: SourceMap.SourceNode) {
node.add('foo');
node.add(new SourceMap.SourceNode());
node.add([new SourceMap.SourceNode(), 'bar']);
}
function testPrepend(node: SourceMap.SourceNode) {
node.prepend('foo');
node.prepend(new SourceMap.SourceNode());
node.prepend([new SourceMap.SourceNode(), 'bar']);
}
function testSetSourceContent(node: SourceMap.SourceNode) {