TypeScript @angular-compiler-testing-src-output-source_map_util.extractSourceMap类(方法)实例源码

下面列出了TypeScript @angular-compiler-testing-src-output-source_map_util.extractSourceMap 类(方法)源码代码实例,从而了解它的用法。

作者:DeepanParik    项目:angula   
it('should map non template parts to the factory file', () => {
        appDir['app.component.ts'] = createComponentSource(templateDecorator('Hello World!'));

        const genFile = compileApp();
        const genSource = toTypeScript(genFile);
        const sourceMap = extractSourceMap(genSource) !;
        expect(originalPositionFor(sourceMap, {line: 1, column: 0}))
            .toEqual({line: 1, column: 0, source: ngFactoryPath});
      });

作者:Cammisul    项目:angula   
function emitSourceMap(stmt: o.Statement | o.Statement[], preamble?: string): SourceMap {
   const stmts = Array.isArray(stmt) ? stmt : [stmt];
   const source = emitter.emitStatements(someGenFilePath, stmts, preamble);
   return extractSourceMap(source) !;
 }


问题


面经


文章

微信
公众号

扫码关注公众号