f467e9ccf9
Bug: v8:10667, v8:10933 Change-Id: I06ebcdf12ee5acbd56ef3741af2b592b5d0351a1 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2435209 Commit-Queue: Camillo Bruni <cbruni@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#70166}
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
// Copyright 2017 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import { WebInspector } from "./sourcemap.mjs";
|
|
import {
|
|
MapProcessor, ArgumentsProcessor, readFile
|
|
} from "./map-processor.mjs";
|
|
|
|
function processArguments(args) {
|
|
var processor = new ArgumentsProcessor(args);
|
|
if (processor.parse()) {
|
|
return processor.result();
|
|
} else {
|
|
processor.printUsageAndExit();
|
|
}
|
|
}
|
|
|
|
function initSourceMapSupport() {
|
|
// Pull dev tools source maps into our name space.
|
|
SourceMap = WebInspector.SourceMap;
|
|
|
|
// Overwrite the load function to load scripts synchronously.
|
|
SourceMap.load = function(sourceMapURL) {
|
|
var content = readFile(sourceMapURL);
|
|
var sourceMapObject = (JSON.parse(content));
|
|
return new SourceMap(sourceMapURL, sourceMapObject);
|
|
};
|
|
}
|
|
|
|
var params = processArguments(arguments);
|
|
var sourceMap = null;
|
|
if (params.sourceMap) {
|
|
initSourceMapSupport();
|
|
sourceMap = SourceMap.load(params.sourceMap);
|
|
}
|
|
var mapProcessor = new MapProcessor();
|
|
mapProcessor.processLogFile(params.logFileName);
|