feat(compiler): add support for source map generation (#14258)

fixes #14125

PR Close #14258
This commit is contained in:
Victor Berchet
2017-01-27 14:23:12 -08:00
committed by Miško Hevery
parent 53cf2ec573
commit 7ac38aa357
20 changed files with 1061 additions and 381 deletions

View File

@ -7,7 +7,6 @@
*/
import {escapeIdentifier} from '@angular/compiler/src/output/abstract_emitter';
import {describe, expect, it} from '@angular/core/testing/testing_internal';
export function main() {
describe('AbstractEmitter', () => {
@ -31,6 +30,11 @@ export function main() {
it('does not escape class (but it probably should)',
() => { expect(escapeIdentifier('class', false, false)).toEqual('class'); });
});
});
}
export function stripSourceMap(source: string): string {
const smi = source.lastIndexOf('\n//#');
if (smi == -1) return source;
return source.slice(0, smi);
}