Merge inbound to mozilla-central. a=merge

This commit is contained in:
shindli 2018-02-20 21:09:49 +02:00
Родитель 04142e96e3 b33bb18330
Коммит f1c5255ad4
157 изменённых файлов: 44540 добавлений и 17424 удалений

Просмотреть файл

@ -9,7 +9,7 @@ this.EXPORTED_SYMBOLS = [ "BingTranslator" ];
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/Log.jsm");
ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm");
ChromeUtils.import("resource://services-common/utils.js");
ChromeUtils.import("resource://services-common/async.js");
ChromeUtils.import("resource://gre/modules/Http.jsm");
Cu.importGlobalProperties(["XMLHttpRequest"]);
@ -69,7 +69,7 @@ this.BingTranslator.prototype = {
// let's take the opportunity of the chunkification process to
// allow for the event loop to attend other pending events
// before we continue.
await CommonUtils.laterTickResolvingPromise();
await Async.promiseYield();
// Determine the data for the next request.
let request = this._generateNextTranslationRequest(currentIndex);

Просмотреть файл

@ -8,7 +8,7 @@ this.EXPORTED_SYMBOLS = [ "TranslationDocument" ];
const TEXT_NODE = Ci.nsIDOMNode.TEXT_NODE;
ChromeUtils.import("resource://services-common/utils.js");
ChromeUtils.import("resource://services-common/async.js");
/**
* This class represents a document that is being translated,
@ -208,14 +208,10 @@ this.TranslationDocument.prototype = {
// Let the event loop breath on every 100 nodes
// that are replaced.
const YIELD_INTERVAL = 100;
let count = YIELD_INTERVAL;
let maybeYield = Async.jankYielder(YIELD_INTERVAL);
for (let root of this.roots) {
root.swapText(target);
if (count-- == 0) {
count = YIELD_INTERVAL;
await CommonUtils.laterTickResolvingPromise();
}
await maybeYield();
}
})();
}

Просмотреть файл

@ -9,7 +9,7 @@ this.EXPORTED_SYMBOLS = [ "YandexTranslator" ];
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/Log.jsm");
ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm");
ChromeUtils.import("resource://services-common/utils.js");
ChromeUtils.import("resource://services-common/async.js");
ChromeUtils.import("resource://gre/modules/Http.jsm");
Cu.importGlobalProperties(["XMLHttpRequest"]);
@ -87,7 +87,7 @@ this.YandexTranslator.prototype = {
// let's take the opportunity of the chunkification process to
// allow for the event loop to attend other pending events
// before we continue.
await CommonUtils.laterTickResolvingPromise();
await Async.promiseYield();
// Determine the data for the next request.
let request = this._generateNextTranslationRequest(currentIndex);

Просмотреть файл

@ -1,5 +1,5 @@
This is the PDF.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 2.0.332
Current extension version is: 2.0.385
Taken from upstream commit: 6b7e2cbc
Taken from upstream commit: 99060e24

Просмотреть файл

@ -81,7 +81,6 @@ function initializeDefaultPreferences() {
"showPreviousViewOnLoad": true,
"defaultZoomValue": "",
"sidebarViewOnLoad": 0,
"enableHandToolOnLoad": false,
"cursorToolOnLoad": 0,
"enableWebGL": false,
"pdfBugEnabled": false,
@ -89,10 +88,9 @@ function initializeDefaultPreferences() {
"disableStream": false,
"disableAutoFetch": false,
"disableFontFace": false,
"disableTextLayer": false,
"textLayerMode": 1,
"useOnlyCssZoom": false,
"externalLinkTarget": 0,
"enhanceTextSelection": false,
"renderer": "canvas",
"renderInteractiveForms": false,
"enablePrintAutoRotate": false,

Просмотреть файл

@ -108,7 +108,7 @@ function getDOMWindow(aChannel) {
var requestor = aChannel.notificationCallbacks ?
aChannel.notificationCallbacks :
aChannel.loadGroup.notificationCallbacks;
var win = requestor.getInterface(Components.interfaces.nsIDOMWindow);
var win = requestor.getInterface(Ci.nsIDOMWindow);
return win;
}

Просмотреть файл

@ -34,7 +34,6 @@ var DEFAULT_PREFERENCES =
"showPreviousViewOnLoad": true,
"defaultZoomValue": "",
"sidebarViewOnLoad": 0,
"enableHandToolOnLoad": false,
"cursorToolOnLoad": 0,
"enableWebGL": false,
"pdfBugEnabled": false,
@ -42,10 +41,9 @@ var DEFAULT_PREFERENCES =
"disableStream": false,
"disableAutoFetch": false,
"disableFontFace": false,
"disableTextLayer": false,
"textLayerMode": 1,
"useOnlyCssZoom": false,
"externalLinkTarget": 0,
"enhanceTextSelection": false,
"renderer": "canvas",
"renderInteractiveForms": false,
"enablePrintAutoRotate": false,

Просмотреть файл

@ -17,7 +17,6 @@
var EXPORTED_SYMBOLS = ["PdfjsContentUtils"];
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
var PdfjsContentUtils = {

Просмотреть файл

@ -92,7 +92,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ __w_pdfjs_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __w_pdfjs_require__(__w_pdfjs_require__.s = 8);
/******/ return __w_pdfjs_require__(__w_pdfjs_require__.s = 9);
/******/ })
/************************************************************************/
/******/ ([
@ -105,11 +105,11 @@ return /******/ (function(modules) { // webpackBootstrap
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VerbosityLevel = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
__w_pdfjs_require__(9);
__w_pdfjs_require__(10);
var _streams_polyfill = __w_pdfjs_require__(10);
var _streams_polyfill = __w_pdfjs_require__(11);
var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
const NativeImageDecoding = {
@ -227,10 +227,10 @@ var FontType = {
TYPE0: 9,
MMTYPE1: 10
};
var VERBOSITY_LEVELS = {
errors: 0,
warnings: 1,
infos: 5
const VerbosityLevel = {
ERRORS: 0,
WARNINGS: 1,
INFOS: 5
};
var CMapCompressionType = {
NONE: 0,
@ -330,20 +330,22 @@ var OPS = {
paintSolidColorImageMask: 90,
constructPath: 91
};
var verbosity = VERBOSITY_LEVELS.warnings;
let verbosity = VerbosityLevel.WARNINGS;
function setVerbosityLevel(level) {
verbosity = level;
if (Number.isInteger(level)) {
verbosity = level;
}
}
function getVerbosityLevel() {
return verbosity;
}
function info(msg) {
if (verbosity >= VERBOSITY_LEVELS.infos) {
if (verbosity >= VerbosityLevel.INFOS) {
console.log('Info: ' + msg);
}
}
function warn(msg) {
if (verbosity >= VERBOSITY_LEVELS.warnings) {
if (verbosity >= VerbosityLevel.WARNINGS) {
console.log('Warning: ' + msg);
}
}
@ -1310,21 +1312,10 @@ MessageHandler.prototype = {
this.comObj.removeEventListener('message', this._onComObjOnMessage);
}
};
function loadJpegStream(id, imageUrl, objs) {
var img = new Image();
img.onload = function loadJpegStream_onloadClosure() {
objs.resolve(id, img);
};
img.onerror = function loadJpegStream_onerrorClosure() {
objs.resolve(id, null);
warn('Error during JPEG image loading');
};
img.src = imageUrl;
}
exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX;
exports.IDENTITY_MATRIX = IDENTITY_MATRIX;
exports.OPS = OPS;
exports.VERBOSITY_LEVELS = VERBOSITY_LEVELS;
exports.VerbosityLevel = VerbosityLevel;
exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES;
exports.AnnotationBorderStyleType = AnnotationBorderStyleType;
exports.AnnotationFieldFlag = AnnotationFieldFlag;
@ -1371,7 +1362,6 @@ exports.isSameOrigin = isSameOrigin;
exports.createValidAbsoluteUrl = createValidAbsoluteUrl;
exports.isLittleEndian = isLittleEndian;
exports.isEvalSupported = isEvalSupported;
exports.loadJpegStream = loadJpegStream;
exports.log2 = log2;
exports.readInt8 = readInt8;
exports.readUint16 = readUint16;
@ -1398,7 +1388,7 @@ exports.unreachable = unreachable;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DummyStatTimer = exports.StatTimer = exports.SimpleXMLParser = exports.DOMSVGFactory = exports.DOMCMapReaderFactory = exports.DOMCanvasFactory = exports.DEFAULT_LINK_REL = exports.getDefaultSetting = exports.LinkTarget = exports.getFilenameFromUrl = exports.isExternalLinkTargetSet = exports.addLinkAttributes = exports.RenderingCancelledException = undefined;
exports.DummyStatTimer = exports.StatTimer = exports.SimpleXMLParser = exports.DOMSVGFactory = exports.DOMCMapReaderFactory = exports.DOMCanvasFactory = exports.DEFAULT_LINK_REL = exports.getDefaultSetting = exports.LinkTarget = exports.getFilenameFromUrl = exports.addLinkAttributes = exports.RenderingCancelledException = undefined;
var _util = __w_pdfjs_require__(0);
@ -1615,28 +1605,21 @@ var RenderingCancelledException = function RenderingCancelledException() {
RenderingCancelledException.constructor = RenderingCancelledException;
return RenderingCancelledException;
}();
var LinkTarget = {
const LinkTarget = {
NONE: 0,
SELF: 1,
BLANK: 2,
PARENT: 3,
TOP: 4
};
var LinkTargetStringMap = ['', '_self', '_blank', '_parent', '_top'];
function addLinkAttributes(link, params) {
var url = params && params.url;
const LinkTargetStringMap = ['', '_self', '_blank', '_parent', '_top'];
function addLinkAttributes(link, { url, target, rel } = {}) {
link.href = link.title = url ? (0, _util.removeNullCharacters)(url) : '';
if (url) {
var target = params.target;
if (typeof target === 'undefined') {
target = getDefaultSetting('externalLinkTarget');
}
link.target = LinkTargetStringMap[target];
var rel = params.rel;
if (typeof rel === 'undefined') {
rel = getDefaultSetting('externalLinkRel');
}
link.rel = rel;
const LinkTargetValues = Object.values(LinkTarget);
let targetIndex = LinkTargetValues.includes(target) ? target : LinkTarget.NONE;
link.target = LinkTargetStringMap[targetIndex];
link.rel = typeof rel === 'string' ? rel : DEFAULT_LINK_REL;
}
}
function getFilenameFromUrl(url) {
@ -1660,59 +1643,18 @@ function getDefaultSetting(id) {
return globalSettings ? globalSettings.disableFontFace : false;
case 'disableCreateObjectURL':
return globalSettings ? globalSettings.disableCreateObjectURL : false;
case 'disableWebGL':
return globalSettings ? globalSettings.disableWebGL : true;
case 'cMapUrl':
return globalSettings ? globalSettings.cMapUrl : null;
case 'cMapPacked':
return globalSettings ? globalSettings.cMapPacked : false;
case 'postMessageTransfers':
return globalSettings ? globalSettings.postMessageTransfers : true;
case 'workerPort':
return globalSettings ? globalSettings.workerPort : null;
case 'workerSrc':
return globalSettings ? globalSettings.workerSrc : null;
case 'maxImageSize':
return globalSettings ? globalSettings.maxImageSize : -1;
case 'imageResourcesPath':
return globalSettings ? globalSettings.imageResourcesPath : '';
case 'isEvalSupported':
return globalSettings ? globalSettings.isEvalSupported : true;
case 'externalLinkTarget':
if (!globalSettings) {
return LinkTarget.NONE;
}
switch (globalSettings.externalLinkTarget) {
case LinkTarget.NONE:
case LinkTarget.SELF:
case LinkTarget.BLANK:
case LinkTarget.PARENT:
case LinkTarget.TOP:
return globalSettings.externalLinkTarget;
}
(0, _util.warn)('PDFJS.externalLinkTarget is invalid: ' + globalSettings.externalLinkTarget);
globalSettings.externalLinkTarget = LinkTarget.NONE;
return LinkTarget.NONE;
case 'externalLinkRel':
return globalSettings ? globalSettings.externalLinkRel : DEFAULT_LINK_REL;
case 'enableStats':
return !!(globalSettings && globalSettings.enableStats);
default:
throw new Error('Unknown default setting: ' + id);
}
}
function isExternalLinkTargetSet() {
var externalLinkTarget = getDefaultSetting('externalLinkTarget');
switch (externalLinkTarget) {
case LinkTarget.NONE:
return false;
case LinkTarget.SELF:
case LinkTarget.BLANK:
case LinkTarget.PARENT:
case LinkTarget.TOP:
return true;
}
}
class StatTimer {
constructor(enable = true) {
this.enabled = !!enable;
@ -1772,7 +1714,6 @@ class DummyStatTimer {
}
exports.RenderingCancelledException = RenderingCancelledException;
exports.addLinkAttributes = addLinkAttributes;
exports.isExternalLinkTargetSet = isExternalLinkTargetSet;
exports.getFilenameFromUrl = getFilenameFromUrl;
exports.LinkTarget = LinkTarget;
exports.getDefaultSetting = getDefaultSetting;
@ -1800,6 +1741,21 @@ module.exports = typeof window !== 'undefined' && window.Math === Math ? window
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const GlobalWorkerOptions = Object.create(null);
GlobalWorkerOptions.workerPort = GlobalWorkerOptions.workerPort === undefined ? null : GlobalWorkerOptions.workerPort;
GlobalWorkerOptions.workerSrc = GlobalWorkerOptions.workerSrc === undefined ? '' : GlobalWorkerOptions.workerSrc;
exports.GlobalWorkerOptions = GlobalWorkerOptions;
/***/ }),
/* 4 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@ -1809,27 +1765,28 @@ var _util = __w_pdfjs_require__(0);
var _dom_utils = __w_pdfjs_require__(1);
var _font_loader = __w_pdfjs_require__(13);
var _font_loader = __w_pdfjs_require__(14);
var _canvas = __w_pdfjs_require__(14);
var _canvas = __w_pdfjs_require__(15);
var _global_scope = __w_pdfjs_require__(2);
var _global_scope2 = _interopRequireDefault(_global_scope);
var _metadata = __w_pdfjs_require__(4);
var _worker_options = __w_pdfjs_require__(3);
var _transport_stream = __w_pdfjs_require__(16);
var _metadata = __w_pdfjs_require__(5);
var _webgl = __w_pdfjs_require__(17);
var _transport_stream = __w_pdfjs_require__(17);
var _webgl = __w_pdfjs_require__(18);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var DEFAULT_RANGE_CHUNK_SIZE = 65536;
var isWorkerDisabled = false;
var workerSrc;
var isPostMessageTransfersDisabled = false;
var pdfjsFilePath = null;
let isWorkerDisabled = false;
let workerSrc;
const pdfjsFilePath = null;
var fakeWorkerFilesLoader = null;
var useRequireEnsure = false;
;
@ -1857,7 +1814,7 @@ function getDocument(src) {
}
var params = {};
var rangeTransport = null;
var worker = null;
let worker = null;
var CMapReaderFactory = _dom_utils.DOMCMapReaderFactory;
for (var key in source) {
if (key === 'url' && typeof window !== 'undefined') {
@ -1893,9 +1850,19 @@ function getDocument(src) {
if (params.nativeImageDecoderSupport === undefined || !nativeImageDecoderValues.includes(params.nativeImageDecoderSupport)) {
params.nativeImageDecoderSupport = _util.NativeImageDecoding.DECODE;
}
(0, _util.setVerbosityLevel)(params.verbosity);
if (!worker) {
var workerPort = (0, _dom_utils.getDefaultSetting)('workerPort');
worker = workerPort ? PDFWorker.fromPort(workerPort) : new PDFWorker();
const workerParams = {
postMessageTransfers: params.postMessageTransfers,
verbosity: params.verbosity
};
let workerPort = _worker_options.GlobalWorkerOptions.workerPort;
if (workerPort) {
workerParams.port = workerPort;
worker = PDFWorker.fromPort(workerParams);
} else {
worker = new PDFWorker(workerParams);
}
task._worker = worker;
}
var docId = task.docId;
@ -1926,7 +1893,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
if (worker.destroyed) {
return Promise.reject(new Error('Worker was destroyed'));
}
let apiVersion = '2.0.332';
let apiVersion = '2.0.385';
source.disableRange = (0, _dom_utils.getDefaultSetting)('disableRange');
source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
@ -1948,7 +1915,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
maxImageSize: (0, _dom_utils.getDefaultSetting)('maxImageSize'),
disableFontFace: (0, _dom_utils.getDefaultSetting)('disableFontFace'),
disableCreateObjectURL: (0, _dom_utils.getDefaultSetting)('disableCreateObjectURL'),
postMessageTransfers: (0, _dom_utils.getDefaultSetting)('postMessageTransfers') && !isPostMessageTransfersDisabled,
postMessageTransfers: worker.postMessageTransfers,
docBaseUrl: source.docBaseUrl,
nativeImageDecoderSupport: source.nativeImageDecoderSupport,
ignoreErrors: source.ignoreErrors,
@ -2110,7 +2077,7 @@ var PDFPageProxy = function PDFPageProxyClosure() {
this.pageIndex = pageIndex;
this.pageInfo = pageInfo;
this.transport = transport;
this._stats = (0, _dom_utils.getDefaultSetting)('enableStats') ? new _dom_utils.StatTimer() : _dom_utils.DummyStatTimer;
this._stats = (0, _dom_utils.getDefaultSetting)('pdfBug') ? new _dom_utils.StatTimer() : _dom_utils.DummyStatTimer;
this.commonObjs = transport.commonObjs;
this.objs = new PDFObjects();
this.cleanupAfterRender = false;
@ -2151,7 +2118,7 @@ var PDFPageProxy = function PDFPageProxyClosure() {
this.pendingCleanup = false;
var renderingIntent = params.intent === 'print' ? 'print' : 'display';
var canvasFactory = params.canvasFactory || new _dom_utils.DOMCanvasFactory();
let webGLContext = new _webgl.WebGLContext({ enable: !(0, _dom_utils.getDefaultSetting)('disableWebGL') });
let webGLContext = new _webgl.WebGLContext({ enable: params.enableWebGL });
if (!this.intentStates[renderingIntent]) {
this.intentStates[renderingIntent] = Object.create(null);
}
@ -2417,13 +2384,13 @@ class LoopbackPort {
var PDFWorker = function PDFWorkerClosure() {
let nextFakeWorkerId = 0;
function getWorkerSrc() {
if (_worker_options.GlobalWorkerOptions.workerSrc) {
return _worker_options.GlobalWorkerOptions.workerSrc;
}
if (typeof workerSrc !== 'undefined') {
return workerSrc;
}
if ((0, _dom_utils.getDefaultSetting)('workerSrc')) {
return (0, _dom_utils.getDefaultSetting)('workerSrc');
}
throw new Error('No PDFJS.workerSrc specified');
throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
}
function getMainThreadWorkerMessageHandler() {
if (typeof window === 'undefined') {
@ -2455,13 +2422,14 @@ var PDFWorker = function PDFWorkerClosure() {
return URL.createObjectURL(new Blob([wrapper]));
}
let pdfWorkerPorts = new WeakMap();
function PDFWorker(name, port) {
function PDFWorker({ name = null, port = null, postMessageTransfers = true, verbosity = null } = {}) {
if (port && pdfWorkerPorts.has(port)) {
throw new Error('Cannot use more than one PDFWorker per port');
}
this.name = name;
this.destroyed = false;
this.postMessageTransfers = true;
this.postMessageTransfers = postMessageTransfers !== false;
this.verbosity = (0, _util.isNum)(verbosity) ? verbosity : (0, _util.getVerbosityLevel)();
this._readyCapability = (0, _util.createPromiseCapability)();
this._port = null;
this._webWorker = null;
@ -2524,10 +2492,9 @@ var PDFWorker = function PDFWorkerClosure() {
this._webWorker = worker;
if (!data.supportTransfers) {
this.postMessageTransfers = false;
isPostMessageTransfersDisabled = true;
}
this._readyCapability.resolve();
messageHandler.send('configure', { verbosity: (0, _util.getVerbosityLevel)() });
messageHandler.send('configure', { verbosity: this.verbosity });
} else {
this._setupFakeWorker();
messageHandler.destroy();
@ -2546,9 +2513,8 @@ var PDFWorker = function PDFWorkerClosure() {
this._setupFakeWorker();
}
});
var sendTest = function () {
var postMessageTransfers = (0, _dom_utils.getDefaultSetting)('postMessageTransfers') && !isPostMessageTransfersDisabled;
var testObj = new Uint8Array([postMessageTransfers ? 255 : 0]);
const sendTest = () => {
let testObj = new Uint8Array([this.postMessageTransfers ? 255 : 0]);
try {
messageHandler.send('test', testObj, [testObj.buffer]);
} catch (ex) {
@ -2600,11 +2566,11 @@ var PDFWorker = function PDFWorkerClosure() {
}
}
};
PDFWorker.fromPort = function (port) {
if (pdfWorkerPorts.has(port)) {
return pdfWorkerPorts.get(port);
PDFWorker.fromPort = function (params) {
if (pdfWorkerPorts.has(params.port)) {
return pdfWorkerPorts.get(params.port);
}
return new PDFWorker(null, port);
return new PDFWorker(params);
};
PDFWorker.getWorkerSrc = function () {
return getWorkerSrc();
@ -2852,8 +2818,18 @@ var WorkerTransport = function WorkerTransportClosure() {
switch (type) {
case 'JpegStream':
imageData = data[3];
(0, _util.loadJpegStream)(id, imageData, pageProxy.objs);
break;
return new Promise((resolve, reject) => {
const img = new Image();
img.onload = function () {
resolve(img);
};
img.onerror = function () {
reject(new Error('Error during JPEG image loading'));
};
img.src = imageData;
}).then(img => {
pageProxy.objs.resolve(id, img);
});
case 'Image':
imageData = data[3];
pageProxy.objs.resolve(id, imageData);
@ -3234,8 +3210,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
}();
var version, build;
{
exports.version = version = '2.0.332';
exports.build = build = '6b7e2cbc';
exports.version = version = '2.0.385';
exports.build = build = '99060e24';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -3248,7 +3224,7 @@ exports.version = version;
exports.build = build;
/***/ }),
/* 4 */
/* 5 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -3343,7 +3319,7 @@ class Metadata {
exports.Metadata = Metadata;
/***/ }),
/* 5 */
/* 6 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -3511,16 +3487,18 @@ class LinkAnnotationElement extends AnnotationElement {
}
render() {
this.container.className = 'linkAnnotation';
let { data, linkService } = this;
let link = document.createElement('a');
(0, _dom_utils.addLinkAttributes)(link, {
url: this.data.url,
target: this.data.newWindow ? _dom_utils.LinkTarget.BLANK : undefined
url: data.url,
target: data.newWindow ? _dom_utils.LinkTarget.BLANK : linkService.externalLinkTarget,
rel: linkService.externalLinkRel
});
if (!this.data.url) {
if (this.data.action) {
this._bindNamedAction(link, this.data.action);
if (!data.url) {
if (data.action) {
this._bindNamedAction(link, data.action);
} else {
this._bindLink(link, this.data.dest);
this._bindLink(link, data.dest);
}
}
this.container.appendChild(link);
@ -4033,7 +4011,7 @@ class AnnotationLayer {
viewport: parameters.viewport,
linkService: parameters.linkService,
downloadManager: parameters.downloadManager,
imageResourcesPath: parameters.imageResourcesPath || (0, _dom_utils.getDefaultSetting)('imageResourcesPath'),
imageResourcesPath: parameters.imageResourcesPath || '',
renderInteractiveForms: parameters.renderInteractiveForms || false,
svgFactory: new _dom_utils.DOMSVGFactory()
});
@ -4056,7 +4034,7 @@ class AnnotationLayer {
exports.AnnotationLayer = AnnotationLayer;
/***/ }),
/* 6 */
/* 7 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -4594,7 +4572,7 @@ var renderTextLayer = function renderTextLayerClosure() {
exports.renderTextLayer = renderTextLayer;
/***/ }),
/* 7 */
/* 8 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -4609,7 +4587,7 @@ var _util = __w_pdfjs_require__(0);
var _dom_utils = __w_pdfjs_require__(1);
var _is_node = __w_pdfjs_require__(18);
var _is_node = __w_pdfjs_require__(19);
var _is_node2 = _interopRequireDefault(_is_node);
@ -4622,21 +4600,22 @@ var SVGGraphics = function () {
exports.SVGGraphics = SVGGraphics;
/***/ }),
/* 8 */
/* 9 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
var pdfjsVersion = '2.0.332';
var pdfjsBuild = '6b7e2cbc';
var pdfjsVersion = '2.0.385';
var pdfjsBuild = '99060e24';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(12);
var pdfjsDisplayAPI = __w_pdfjs_require__(3);
var pdfjsDisplayTextLayer = __w_pdfjs_require__(6);
var pdfjsDisplayAnnotationLayer = __w_pdfjs_require__(5);
var pdfjsDisplayGlobal = __w_pdfjs_require__(13);
var pdfjsDisplayAPI = __w_pdfjs_require__(4);
var pdfjsDisplayTextLayer = __w_pdfjs_require__(7);
var pdfjsDisplayAnnotationLayer = __w_pdfjs_require__(6);
var pdfjsDisplayDOMUtils = __w_pdfjs_require__(1);
var pdfjsDisplaySVG = __w_pdfjs_require__(7);
var pdfjsDisplaySVG = __w_pdfjs_require__(8);
let pdfjsDisplayWorkerOptions = __w_pdfjs_require__(3);
;
exports.PDFJS = pdfjsDisplayGlobal.PDFJS;
exports.build = pdfjsDisplayAPI.build;
@ -4655,6 +4634,7 @@ exports.SVGGraphics = pdfjsDisplaySVG.SVGGraphics;
exports.NativeImageDecoding = pdfjsSharedUtil.NativeImageDecoding;
exports.UnexpectedResponseException = pdfjsSharedUtil.UnexpectedResponseException;
exports.OPS = pdfjsSharedUtil.OPS;
exports.VerbosityLevel = pdfjsSharedUtil.VerbosityLevel;
exports.UNSUPPORTED_FEATURES = pdfjsSharedUtil.UNSUPPORTED_FEATURES;
exports.createValidAbsoluteUrl = pdfjsSharedUtil.createValidAbsoluteUrl;
exports.createObjectURL = pdfjsSharedUtil.createObjectURL;
@ -4663,10 +4643,12 @@ exports.shadow = pdfjsSharedUtil.shadow;
exports.createBlob = pdfjsSharedUtil.createBlob;
exports.RenderingCancelledException = pdfjsDisplayDOMUtils.RenderingCancelledException;
exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl;
exports.LinkTarget = pdfjsDisplayDOMUtils.LinkTarget;
exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes;
exports.GlobalWorkerOptions = pdfjsDisplayWorkerOptions.GlobalWorkerOptions;
/***/ }),
/* 9 */
/* 10 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -4675,7 +4657,7 @@ exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes;
;
/***/ }),
/* 10 */
/* 11 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -4695,11 +4677,11 @@ if (typeof ReadableStream !== 'undefined') {
if (isReadableStreamSupported) {
exports.ReadableStream = ReadableStream;
} else {
exports.ReadableStream = __w_pdfjs_require__(11).ReadableStream;
exports.ReadableStream = __w_pdfjs_require__(12).ReadableStream;
}
/***/ }),
/* 11 */
/* 12 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -7715,7 +7697,7 @@ if (isReadableStreamSupported) {
}]));
/***/ }),
/* 12 */
/* 13 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -7726,23 +7708,25 @@ Object.defineProperty(exports, "__esModule", {
});
exports.PDFJS = exports.globalScope = undefined;
var _dom_utils = __w_pdfjs_require__(1);
var _util = __w_pdfjs_require__(0);
var _api = __w_pdfjs_require__(3);
var _dom_utils = __w_pdfjs_require__(1);
var _annotation_layer = __w_pdfjs_require__(5);
var _api = __w_pdfjs_require__(4);
var _annotation_layer = __w_pdfjs_require__(6);
var _global_scope = __w_pdfjs_require__(2);
var _global_scope2 = _interopRequireDefault(_global_scope);
var _metadata = __w_pdfjs_require__(4);
var _worker_options = __w_pdfjs_require__(3);
var _text_layer = __w_pdfjs_require__(6);
var _metadata = __w_pdfjs_require__(5);
var _svg = __w_pdfjs_require__(7);
var _text_layer = __w_pdfjs_require__(7);
var _svg = __w_pdfjs_require__(8);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@ -7750,29 +7734,9 @@ if (!_global_scope2.default.PDFJS) {
_global_scope2.default.PDFJS = {};
}
var PDFJS = _global_scope2.default.PDFJS;
{
PDFJS.version = '2.0.332';
PDFJS.build = '6b7e2cbc';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
(0, _util.setVerbosityLevel)(PDFJS.verbosity);
}
delete PDFJS.verbosity;
Object.defineProperty(PDFJS, 'verbosity', {
get() {
return (0, _util.getVerbosityLevel)();
},
set(level) {
(0, _util.setVerbosityLevel)(level);
},
enumerable: true,
configurable: true
});
PDFJS.VERBOSITY_LEVELS = _util.VERBOSITY_LEVELS;
PDFJS.OPS = _util.OPS;
PDFJS.UNSUPPORTED_FEATURES = _util.UNSUPPORTED_FEATURES;
PDFJS.isValidUrl = _dom_utils.isValidUrl;
PDFJS.shadow = _util.shadow;
PDFJS.createBlob = _util.createBlob;
PDFJS.createObjectURL = function PDFJS_createObjectURL(data, contentType) {
@ -7798,16 +7762,11 @@ PDFJS.maxImageSize = PDFJS.maxImageSize === undefined ? -1 : PDFJS.maxImageSize;
PDFJS.cMapUrl = PDFJS.cMapUrl === undefined ? null : PDFJS.cMapUrl;
PDFJS.cMapPacked = PDFJS.cMapPacked === undefined ? false : PDFJS.cMapPacked;
PDFJS.disableFontFace = PDFJS.disableFontFace === undefined ? false : PDFJS.disableFontFace;
PDFJS.imageResourcesPath = PDFJS.imageResourcesPath === undefined ? '' : PDFJS.imageResourcesPath;
PDFJS.workerSrc = PDFJS.workerSrc === undefined ? null : PDFJS.workerSrc;
PDFJS.workerPort = PDFJS.workerPort === undefined ? null : PDFJS.workerPort;
PDFJS.disableRange = PDFJS.disableRange === undefined ? false : PDFJS.disableRange;
PDFJS.disableStream = PDFJS.disableStream === undefined ? false : PDFJS.disableStream;
PDFJS.disableAutoFetch = PDFJS.disableAutoFetch === undefined ? false : PDFJS.disableAutoFetch;
PDFJS.pdfBug = PDFJS.pdfBug === undefined ? false : PDFJS.pdfBug;
PDFJS.postMessageTransfers = PDFJS.postMessageTransfers === undefined ? true : PDFJS.postMessageTransfers;
PDFJS.disableCreateObjectURL = PDFJS.disableCreateObjectURL === undefined ? false : PDFJS.disableCreateObjectURL;
PDFJS.disableWebGL = PDFJS.disableWebGL === undefined ? true : PDFJS.disableWebGL;
PDFJS.externalLinkTarget = PDFJS.externalLinkTarget === undefined ? _dom_utils.LinkTarget.NONE : PDFJS.externalLinkTarget;
PDFJS.externalLinkRel = PDFJS.externalLinkRel === undefined ? _dom_utils.DEFAULT_LINK_REL : PDFJS.externalLinkRel;
PDFJS.isEvalSupported = PDFJS.isEvalSupported === undefined ? true : PDFJS.isEvalSupported;
@ -7815,10 +7774,8 @@ PDFJS.getDocument = _api.getDocument;
PDFJS.LoopbackPort = _api.LoopbackPort;
PDFJS.PDFDataRangeTransport = _api.PDFDataRangeTransport;
PDFJS.PDFWorker = _api.PDFWorker;
PDFJS.LinkTarget = _dom_utils.LinkTarget;
PDFJS.addLinkAttributes = _dom_utils.addLinkAttributes;
PDFJS.GlobalWorkerOptions = _worker_options.GlobalWorkerOptions;
PDFJS.getFilenameFromUrl = _dom_utils.getFilenameFromUrl;
PDFJS.isExternalLinkTargetSet = _dom_utils.isExternalLinkTargetSet;
PDFJS.AnnotationLayer = _annotation_layer.AnnotationLayer;
PDFJS.renderTextLayer = _text_layer.renderTextLayer;
PDFJS.Metadata = _metadata.Metadata;
@ -7827,7 +7784,7 @@ exports.globalScope = _global_scope2.default;
exports.PDFJS = PDFJS;
/***/ }),
/* 13 */
/* 14 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -7952,7 +7909,7 @@ exports.FontFaceObject = FontFaceObject;
exports.FontLoader = FontLoader;
/***/ }),
/* 14 */
/* 15 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -7965,7 +7922,7 @@ exports.CanvasGraphics = undefined;
var _util = __w_pdfjs_require__(0);
var _pattern_helper = __w_pdfjs_require__(15);
var _pattern_helper = __w_pdfjs_require__(16);
var MIN_FONT_SIZE = 16;
var MAX_FONT_SIZE = 100;
@ -9693,7 +9650,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
exports.CanvasGraphics = CanvasGraphics;
/***/ }),
/* 15 */
/* 16 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -10075,7 +10032,7 @@ exports.getShadingPatternFromIR = getShadingPatternFromIR;
exports.TilingPattern = TilingPattern;
/***/ }),
/* 16 */
/* 17 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -10098,8 +10055,8 @@ var PDFDataTransportStream = function PDFDataTransportStreamClosure() {
this._queuedChunks.push(buffer);
}
this._pdfDataRangeTransport = pdfDataRangeTransport;
this._isRangeSupported = !params.disableRange;
this._isStreamingSupported = !params.disableStream;
this._isRangeSupported = !params.disableRange;
this._contentLength = params.length;
this._fullRequestReader = null;
this._rangeReaders = [];
@ -10315,7 +10272,7 @@ var PDFDataTransportStream = function PDFDataTransportStreamClosure() {
exports.PDFDataTransportStream = PDFDataTransportStream;
/***/ }),
/* 17 */
/* 18 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";
@ -10698,7 +10655,7 @@ var WebGLUtils = function WebGLUtilsClosure() {
exports.WebGLContext = WebGLContext;
/***/ }),
/* 18 */
/* 19 */
/***/ (function(module, exports, __w_pdfjs_require__) {
"use strict";

Просмотреть файл

@ -105,7 +105,7 @@ return /******/ (function(modules) { // webpackBootstrap
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.loadJpegStream = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VERBOSITY_LEVELS = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
exports.unreachable = exports.warn = exports.utf8StringToString = exports.stringToUTF8String = exports.stringToPDFString = exports.stringToBytes = exports.string32 = exports.shadow = exports.setVerbosityLevel = exports.ReadableStream = exports.removeNullCharacters = exports.readUint32 = exports.readUint16 = exports.readInt8 = exports.log2 = exports.isEvalSupported = exports.isLittleEndian = exports.createValidAbsoluteUrl = exports.isSameOrigin = exports.isSpace = exports.isString = exports.isNum = exports.isEmptyObj = exports.isBool = exports.isArrayBuffer = exports.info = exports.getVerbosityLevel = exports.getLookupTableFactory = exports.deprecated = exports.createObjectURL = exports.createPromiseCapability = exports.createBlob = exports.bytesToString = exports.assert = exports.arraysToBytes = exports.arrayByteLength = exports.FormatError = exports.XRefParseException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PasswordResponses = exports.PasswordException = exports.PageViewport = exports.NotImplementedException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.MessageHandler = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VerbosityLevel = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = undefined;
__w_pdfjs_require__(21);
@ -227,10 +227,10 @@ var FontType = {
TYPE0: 9,
MMTYPE1: 10
};
var VERBOSITY_LEVELS = {
errors: 0,
warnings: 1,
infos: 5
const VerbosityLevel = {
ERRORS: 0,
WARNINGS: 1,
INFOS: 5
};
var CMapCompressionType = {
NONE: 0,
@ -330,20 +330,22 @@ var OPS = {
paintSolidColorImageMask: 90,
constructPath: 91
};
var verbosity = VERBOSITY_LEVELS.warnings;
let verbosity = VerbosityLevel.WARNINGS;
function setVerbosityLevel(level) {
verbosity = level;
if (Number.isInteger(level)) {
verbosity = level;
}
}
function getVerbosityLevel() {
return verbosity;
}
function info(msg) {
if (verbosity >= VERBOSITY_LEVELS.infos) {
if (verbosity >= VerbosityLevel.INFOS) {
console.log('Info: ' + msg);
}
}
function warn(msg) {
if (verbosity >= VERBOSITY_LEVELS.warnings) {
if (verbosity >= VerbosityLevel.WARNINGS) {
console.log('Warning: ' + msg);
}
}
@ -1310,21 +1312,10 @@ MessageHandler.prototype = {
this.comObj.removeEventListener('message', this._onComObjOnMessage);
}
};
function loadJpegStream(id, imageUrl, objs) {
var img = new Image();
img.onload = function loadJpegStream_onloadClosure() {
objs.resolve(id, img);
};
img.onerror = function loadJpegStream_onerrorClosure() {
objs.resolve(id, null);
warn('Error during JPEG image loading');
};
img.src = imageUrl;
}
exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX;
exports.IDENTITY_MATRIX = IDENTITY_MATRIX;
exports.OPS = OPS;
exports.VERBOSITY_LEVELS = VERBOSITY_LEVELS;
exports.VerbosityLevel = VerbosityLevel;
exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES;
exports.AnnotationBorderStyleType = AnnotationBorderStyleType;
exports.AnnotationFieldFlag = AnnotationFieldFlag;
@ -1371,7 +1362,6 @@ exports.isSameOrigin = isSameOrigin;
exports.createValidAbsoluteUrl = createValidAbsoluteUrl;
exports.isLittleEndian = isLittleEndian;
exports.isEvalSupported = isEvalSupported;
exports.loadJpegStream = loadJpegStream;
exports.log2 = log2;
exports.readInt8 = readInt8;
exports.readUint16 = readUint16;
@ -3624,7 +3614,21 @@ var _jpeg_stream = __w_pdfjs_require__(6);
var _jpx_stream = __w_pdfjs_require__(30);
var MAX_LENGTH_TO_CACHE = 1000;
const MAX_LENGTH_TO_CACHE = 1000;
const MAX_ADLER32_LENGTH = 5552;
function computeAdler32(bytes) {
let bytesLength = bytes.length;
if (bytesLength >= MAX_ADLER32_LENGTH) {
throw new Error('computeAdler32: The input is too large.');
}
let a = 1,
b = 0;
for (let i = 0; i < bytesLength; ++i) {
a += bytes[i] & 0xFF;
b += a;
}
return b % 65521 << 16 | a % 65521;
}
var Parser = function ParserClosure() {
function Parser(lexer, allowStreams, xref, recoveryMode) {
this.lexer = lexer;
@ -3913,7 +3917,8 @@ var Parser = function ParserClosure() {
makeInlineImage: function Parser_makeInlineImage(cipherTransform) {
var lexer = this.lexer;
var stream = lexer.stream;
var dict = new _primitives.Dict(this.xref);
let dict = new _primitives.Dict(this.xref),
dictLength;
while (!(0, _primitives.isCmd)(this.buf1, 'ID') && !(0, _primitives.isEOF)(this.buf1)) {
if (!(0, _primitives.isName)(this.buf1)) {
throw new _util.FormatError('Dictionary key must be a name object');
@ -3925,6 +3930,9 @@ var Parser = function ParserClosure() {
}
dict.set(key, this.getObj(cipherTransform));
}
if (lexer.beginInlineImagePos !== -1) {
dictLength = stream.pos - lexer.beginInlineImagePos;
}
var filter = dict.get('Filter', 'F'),
filterName;
if ((0, _primitives.isName)(filter)) {
@ -3935,10 +3943,8 @@ var Parser = function ParserClosure() {
filterName = filterZero.name;
}
}
var startPos = stream.pos,
length,
i,
ii;
let startPos = stream.pos,
length;
if (filterName === 'DCTDecode' || filterName === 'DCT') {
length = this.findDCTDecodeInlineStreamEnd(stream);
} else if (filterName === 'ASCII85Decode' || filterName === 'A85') {
@ -3949,18 +3955,16 @@ var Parser = function ParserClosure() {
length = this.findDefaultInlineStreamEnd(stream);
}
var imageStream = stream.makeSubStream(startPos, length, dict);
var adler32;
if (length < MAX_LENGTH_TO_CACHE) {
let cacheKey;
if (length < MAX_LENGTH_TO_CACHE && dictLength < MAX_ADLER32_LENGTH) {
var imageBytes = imageStream.getBytes();
imageStream.reset();
var a = 1;
var b = 0;
for (i = 0, ii = imageBytes.length; i < ii; ++i) {
a += imageBytes[i] & 0xff;
b += a;
}
adler32 = b % 65521 << 16 | a % 65521;
let cacheEntry = this.imageCache[adler32];
const initialStreamPos = stream.pos;
stream.pos = lexer.beginInlineImagePos;
let dictBytes = stream.getBytes(dictLength);
stream.pos = initialStreamPos;
cacheKey = computeAdler32(imageBytes) + '_' + computeAdler32(dictBytes);
let cacheEntry = this.imageCache[cacheKey];
if (cacheEntry !== undefined) {
this.buf2 = _primitives.Cmd.get('EI');
this.shift();
@ -3973,9 +3977,9 @@ var Parser = function ParserClosure() {
}
imageStream = this.filter(imageStream, dict, length);
imageStream.dict = dict;
if (adler32 !== undefined) {
imageStream.cacheKey = 'inline_' + length + '_' + adler32;
this.imageCache[adler32] = imageStream;
if (cacheKey !== undefined) {
imageStream.cacheKey = 'inline_' + length + '_' + cacheKey;
this.imageCache[cacheKey] = imageStream;
}
this.buf2 = _primitives.Cmd.get('EI');
this.shift();
@ -4148,6 +4152,7 @@ var Lexer = function LexerClosure() {
this.nextChar();
this.strBuf = [];
this.knownCommands = knownCommands;
this.beginInlineImagePos = -1;
}
var specialChars = [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
function toHexDigit(ch) {
@ -4502,6 +4507,9 @@ var Lexer = function LexerClosure() {
if (str === 'null') {
return null;
}
if (str === 'BI') {
this.beginInlineImagePos = this.stream.pos;
}
return _primitives.Cmd.get(str);
},
skipToNextLine: function Lexer_skipToNextLine() {
@ -21065,8 +21073,8 @@ exports.PostScriptCompiler = PostScriptCompiler;
"use strict";
var pdfjsVersion = '2.0.332';
var pdfjsBuild = '6b7e2cbc';
var pdfjsVersion = '2.0.385';
var pdfjsBuild = '99060e24';
var pdfjsCoreWorker = __w_pdfjs_require__(20);
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
@ -21267,7 +21275,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null;
var WorkerTasks = [];
let apiVersion = docParams.apiVersion;
let workerVersion = '2.0.332';
let workerVersion = '2.0.385';
if (apiVersion !== null && apiVersion !== workerVersion) {
throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
}
@ -27326,6 +27334,16 @@ let JpegError = function JpegErrorClosure() {
JpegError.constructor = JpegError;
return JpegError;
}();
let DNLMarkerError = function DNLMarkerErrorClosure() {
function DNLMarkerError(message, scanLines) {
this.message = message;
this.scanLines = scanLines;
}
DNLMarkerError.prototype = new Error();
DNLMarkerError.prototype.name = 'DNLMarkerError';
DNLMarkerError.constructor = DNLMarkerError;
return DNLMarkerError;
}();
var JpegImage = function JpegImageClosure() {
var dctZigZag = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]);
var dctCos1 = 4017;
@ -27388,7 +27406,7 @@ var JpegImage = function JpegImageClosure() {
function getBlockBufferOffset(component, row, col) {
return 64 * ((component.blocksPerLine + 1) * row + col);
}
function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive) {
function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive, parseDNLMarker = false) {
var mcusPerLine = frame.mcusPerLine;
var progressive = frame.progressive;
var startOffset = offset,
@ -27403,6 +27421,13 @@ var JpegImage = function JpegImageClosure() {
if (bitsData === 0xFF) {
var nextByte = data[offset++];
if (nextByte) {
if (nextByte === 0xDC && parseDNLMarker) {
offset += 2;
const scanLines = data[offset++] << 8 | data[offset++];
if (scanLines > 0 && scanLines !== frame.scanLines) {
throw new DNLMarkerError('Found DNL marker (0xFFDC) while parsing scan data', scanLines);
}
}
throw new JpegError(`unexpected marker ${(bitsData << 8 | nextByte).toString(16)}`);
}
}
@ -27838,7 +27863,9 @@ var JpegImage = function JpegImageClosure() {
};
}
JpegImage.prototype = {
parse: function parse(data) {
parse(data, {
dnlScanLines = null
} = {}) {
function readUint16() {
var value = data[offset] << 8 | data[offset + 1];
offset += 2;
@ -27877,6 +27904,7 @@ var JpegImage = function JpegImageClosure() {
var jfif = null;
var adobe = null;
var frame, resetInterval;
let numSOSMarkers = 0;
var quantizationTables = [];
var huffmanTablesAC = [],
huffmanTablesDC = [];
@ -27967,7 +27995,8 @@ var JpegImage = function JpegImageClosure() {
frame.extended = fileMarker === 0xFFC1;
frame.progressive = fileMarker === 0xFFC2;
frame.precision = data[offset++];
frame.scanLines = readUint16();
const sofScanLines = readUint16();
frame.scanLines = dnlScanLines || sofScanLines;
frame.samplesPerLine = readUint16();
frame.components = [];
frame.componentIds = {};
@ -28021,6 +28050,7 @@ var JpegImage = function JpegImageClosure() {
resetInterval = readUint16();
break;
case 0xFFDA:
const parseDNLMarker = ++numSOSMarkers === 1 && !dnlScanLines;
readUint16();
var selectorsCount = data[offset++];
var components = [],
@ -28036,8 +28066,19 @@ var JpegImage = function JpegImageClosure() {
var spectralStart = data[offset++];
var spectralEnd = data[offset++];
var successiveApproximation = data[offset++];
var processed = decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15);
offset += processed;
try {
var processed = decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15, parseDNLMarker);
offset += processed;
} catch (ex) {
if (ex instanceof DNLMarkerError) {
(0, _util.warn)('Attempting to re-parse JPEG image using "scanLines" ' + 'parameter found in DNL marker (0xFFDC) segment.');
return this.parse(data, { dnlScanLines: ex.scanLines });
}
throw ex;
}
break;
case 0xFFDC:
offset += 4;
break;
case 0xFFFF:
if (data[offset] !== 0xFF) {
@ -28162,7 +28203,7 @@ var JpegImage = function JpegImageClosure() {
data[offset++] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665);
data[offset++] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407);
}
return data;
return data.subarray(0, offset);
},
_convertYcckToCmyk: function convertYcckToCmyk(data) {
var Y, Cb, Cr;
@ -28189,7 +28230,7 @@ var JpegImage = function JpegImageClosure() {
data[offset++] = 255 + c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k - 79.2970844816548) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 190.9453302588951) + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) - k * (20.737325471181034 * k + 187.80453709719578);
data[offset++] = 255 + c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k - 14.183576799673286) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 112.23884253719248) + y * (0.03296041114873217 * y + 115.60384449646641 * k - 193.58209356861505) - k * (22.33816807309886 * k + 180.12613974708367);
}
return data;
return data.subarray(0, offset);
},
getData: function getData(width, height, forceRGBoutput) {
if (this.numComponents > 4) {
@ -29045,10 +29086,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
var dict = image.dict;
var colorSpace = dict.get('ColorSpace', 'CS');
colorSpace = _colorspace.ColorSpace.parse(colorSpace, this.xref, this.resources, this.pdfFunctionFactory);
var numComps = colorSpace.numComps;
var decodePromise = this.handler.sendWithPromise('JpegDecode', [image.getIR(this.forceDataSchema), numComps]);
return decodePromise.then(function (message) {
var data = message.data;
return this.handler.sendWithPromise('JpegDecode', [image.getIR(this.forceDataSchema), colorSpace.numComps]).then(function ({ data, width, height }) {
return new _stream.Stream(data, 0, data.length, image.dict);
});
}
@ -29262,18 +29300,18 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}
});
},
buildPaintImageXObject: function PartialEvaluator_buildPaintImageXObject(resources, image, inline, operatorList, cacheKey, imageCache) {
buildPaintImageXObject({ resources, image, isInline = false, operatorList, cacheKey, imageCache, forceDisableNativeImageDecoder = false }) {
var dict = image.dict;
var w = dict.get('Width', 'W');
var h = dict.get('Height', 'H');
if (!(w && (0, _util.isNum)(w)) || !(h && (0, _util.isNum)(h))) {
(0, _util.warn)('Image dimensions are missing, or not numbers.');
return;
return Promise.resolve();
}
var maxImageSize = this.options.maxImageSize;
if (maxImageSize !== -1 && w * h > maxImageSize) {
(0, _util.warn)('Image exceeded maximum allowed size and was removed.');
return;
return Promise.resolve();
}
var imageMask = dict.get('ImageMask', 'IM') || false;
var imgData, args;
@ -29299,37 +29337,48 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
args
};
}
return;
return Promise.resolve();
}
var softMask = dict.get('SMask', 'SM') || false;
var mask = dict.get('Mask') || false;
var SMALL_IMAGE_DIMENSIONS = 200;
if (inline && !softMask && !mask && !(image instanceof _jpeg_stream.JpegStream) && w + h < SMALL_IMAGE_DIMENSIONS) {
if (isInline && !softMask && !mask && !(image instanceof _jpeg_stream.JpegStream) && w + h < SMALL_IMAGE_DIMENSIONS) {
let imageObj = new _image.PDFImage({
xref: this.xref,
res: resources,
image,
isInline: inline,
isInline,
pdfFunctionFactory: this.pdfFunctionFactory
});
imgData = imageObj.createImageData(true);
operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]);
return;
return Promise.resolve();
}
var nativeImageDecoderSupport = this.options.nativeImageDecoderSupport;
const nativeImageDecoderSupport = forceDisableNativeImageDecoder ? _util.NativeImageDecoding.NONE : this.options.nativeImageDecoderSupport;
var objId = 'img_' + this.idFactory.createObjId();
operatorList.addDependency(objId);
args = [objId, w, h];
if (nativeImageDecoderSupport !== _util.NativeImageDecoding.NONE && !softMask && !mask && image instanceof _jpeg_stream.JpegStream && NativeImageDecoder.isSupported(image, this.xref, resources, this.pdfFunctionFactory)) {
operatorList.addOp(_util.OPS.paintJpegXObject, args);
this.handler.send('obj', [objId, this.pageIndex, 'JpegStream', image.getIR(this.options.forceDataSchema)]);
if (cacheKey) {
imageCache[cacheKey] = {
fn: _util.OPS.paintJpegXObject,
args
};
}
return;
return this.handler.sendWithPromise('obj', [objId, this.pageIndex, 'JpegStream', image.getIR(this.options.forceDataSchema)]).then(function () {
operatorList.addDependency(objId);
args = [objId, w, h];
operatorList.addOp(_util.OPS.paintJpegXObject, args);
if (cacheKey) {
imageCache[cacheKey] = {
fn: _util.OPS.paintJpegXObject,
args
};
}
}, reason => {
(0, _util.warn)('Native JPEG decoding failed -- trying to recover: ' + (reason && reason.message));
return this.buildPaintImageXObject({
resources,
image,
isInline,
operatorList,
cacheKey,
imageCache,
forceDisableNativeImageDecoder: true
});
});
}
var nativeImageDecoder = null;
if (nativeImageDecoderSupport === _util.NativeImageDecoding.DECODE && (image instanceof _jpeg_stream.JpegStream || mask instanceof _jpeg_stream.JpegStream || softMask instanceof _jpeg_stream.JpegStream)) {
@ -29341,12 +29390,14 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
pdfFunctionFactory: this.pdfFunctionFactory
});
}
operatorList.addDependency(objId);
args = [objId, w, h];
_image.PDFImage.buildImage({
handler: this.handler,
xref: this.xref,
res: resources,
image,
isInline: inline,
isInline,
nativeDecoder: nativeImageDecoder,
pdfFunctionFactory: this.pdfFunctionFactory
}).then(imageObj => {
@ -29363,6 +29414,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
args
};
}
return Promise.resolve();
},
handleSMask: function PartialEvaluator_handleSmask(smask, resources, operatorList, task, stateManager) {
var smaskContent = smask.get('G');
@ -29736,7 +29788,14 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
}, rejectXObject);
return;
} else if (type.name === 'Image') {
self.buildPaintImageXObject(resources, xobj, false, operatorList, name, imageCache);
self.buildPaintImageXObject({
resources,
image: xobj,
operatorList,
cacheKey: name,
imageCache
}).then(resolveXObject, rejectXObject);
return;
} else if (type.name === 'PS') {
(0, _util.info)('Ignored XObject subtype PS');
} else {
@ -29769,9 +29828,15 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
continue;
}
}
self.buildPaintImageXObject(resources, args[0], true, operatorList, cacheKey, imageCache);
args = null;
continue;
next(self.buildPaintImageXObject({
resources,
image: args[0],
isInline: true,
operatorList,
cacheKey,
imageCache
}));
return;
case _util.OPS.showText:
args[0] = self.handleText(args[0], stateManager.state);
break;
@ -34108,7 +34173,7 @@ var Font = function FontClosure() {
}
font.pos += 4;
maxFunctionDefs = font.getUint16();
font.pos += 6;
font.pos += 4;
maxSizeOfInstructions = font.getUint16();
}
var dupFirstEntry = false;
@ -40561,7 +40626,10 @@ var _jpx = __w_pdfjs_require__(13);
var PDFImage = function PDFImageClosure() {
function handleImageData(image, nativeDecoder) {
if (nativeDecoder && nativeDecoder.canDecode(image)) {
return nativeDecoder.decode(image);
return nativeDecoder.decode(image).catch(reason => {
(0, _util.warn)('Native image decoding failed -- trying to recover: ' + (reason && reason.message));
return image;
});
}
return Promise.resolve(image);
}

Просмотреть файл

@ -338,7 +338,7 @@ var Stepper = (function StepperClosure() {
line.className = 'line';
line.dataset.idx = i;
chunk.appendChild(line);
var checked = this.breakPoints.indexOf(i) !== -1;
var checked = this.breakPoints.includes(i);
var args = operatorList.argsArray[i] || [];
var breakCell = c('td');
@ -462,7 +462,6 @@ var Stats = (function Stats() {
manager: null,
init(pdfjsLib) {
this.panel.setAttribute('style', 'padding: 5px;');
pdfjsLib.PDFJS.enableStats = true;
},
enabled: false,
active: false,
@ -521,7 +520,7 @@ window.PDFBug = (function PDFBugClosure() {
}
for (var i = 0; i < tools.length; ++i) {
var tool = tools[i];
if (all || ids.indexOf(tool.id) !== -1) {
if (all || ids.includes(tool.id)) {
tool.enabled = true;
}
}

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.0 KiB

После

Ширина:  |  Высота:  |  Размер: 1.0 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 217 B

После

Ширина:  |  Высота:  |  Размер: 219 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 165 B

После

Ширина:  |  Высота:  |  Размер: 167 B

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -23,4 +23,7 @@ const ThemeVariableMap = [
["--lwt-toolbarbutton-icon-fill-attention", "icon_attention_color"],
["--lwt-toolbarbutton-hover-background", "button_background_hover"],
["--lwt-toolbarbutton-active-background", "button_background_active"],
["--arrowpanel-background", "popup"],
["--arrowpanel-color", "popup_text"],
["--arrowpanel-border-color", "popup_border"],
];

Просмотреть файл

@ -951,6 +951,18 @@ panelmultiview .toolbaritem-combined-buttons > spacer.after-label {
/* Unset the min-height constraint, because that works better for a text-only button. */
#appMenu-zoomReset-button {
min-height: unset;
border: 1px solid var(--panel-separator-color);
border-radius: 10000px;
padding: 1px 8px;
background-color: var(--arrowpanel-dimmed);
}
#appMenu-zoomReset-button@buttonStateHover@ {
background-color: var(--arrowpanel-dimmed-further);
}
#appMenu-zoomReset-button@buttonStateActive@ {
background-color: var(--arrowpanel-dimmed-even-further);
}
#appMenu-zoomReset-button > .toolbarbutton-text {
@ -968,14 +980,6 @@ panelmultiview .toolbaritem-combined-buttons > spacer.after-label {
display: none;
}
/* Using this selector, because this way the hover and active selectors will apply properly. */
.PanelUI-subView .toolbaritem-combined-buttons > .subviewbutton:not(.subviewbutton-iconic) {
background-color: #f9f9f9;
border: 1px solid #e1e1e1;
border-radius: 10000px;
padding: 1px 8px;
}
.toolbaritem-combined-buttons > .subviewbutton:not(.subviewbutton-iconic) > .toolbarbutton-text {
font-size: 1em;
padding-inline-start: 0;

Просмотреть файл

@ -57,7 +57,7 @@ if test -n "$ENABLE_CLANG_PLUGIN"; then
dnl version that what our build machines have installed.
LLVM_LDFLAGS=`echo "$LLVM_LDFLAGS" | sed -E 's/-L[[^ ]]+\/clang\/lib//'`
elif test "${HOST_OS_ARCH}" = "WINNT"; then
CLANG_LDFLAGS="clang.lib"
CLANG_LDFLAGS="clang.lib clangASTMatchers.lib"
else
CLANG_LDFLAGS="-lclangASTMatchers"
fi

Просмотреть файл

@ -1,8 +1,8 @@
This is the debugger.html project output.
See https://github.com/devtools-html/debugger.html
Version 16.0
Comparison: https://github.com/devtools-html/debugger.html/compare/release-15...release-16
Version 17.0
Comparison: https://github.com/devtools-html/debugger.html/compare/release-16...release-17
Packages:
- babel-plugin-transform-es2015-modules-commonjs @6.26.0

Просмотреть файл

@ -1054,10 +1054,6 @@ html .arrow.expanded svg {
vertical-align: sub;
}
.theme-dark .webpack {
opacity: 0.5;
}
.function svg {
height: 10px;
width: 15px;
@ -1075,13 +1071,19 @@ html .arrow.expanded svg {
vertical-align: sub;
}
.source-icon svg {
fill: var(--theme-body-color);
.angular,
.webpack {
opacity: 0.8;
}
.theme-dark .angular {
.theme-dark .angular,
.theme-dark .webpack {
opacity: 0.5;
}
.source-icon svg {
fill: var(--theme-comment);
}
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
@ -1440,8 +1442,10 @@ html[dir="rtl"] .arrow svg,
.project-text-search .no-result-msg {
color: var(--theme-body-color-inactive);
font-size: 24px;
padding: 4px;
word-break: break-all;
padding: 4px 15px;
max-width: 100%;
overflow-wrap: break-word;
hyphens: auto;
}
.project-text-search .file-result {
@ -1637,7 +1641,7 @@ html[dir="rtl"] .arrow svg,
}
.theme-dark .sources-list .managed-tree .tree .node:not(.focused) img.blackBox {
background-color: var(--theme-content-color3);
background-color: var(--theme-comment);
}
.theme-dark .sources-list .managed-tree .tree .node img.blackBox {
@ -2448,7 +2452,7 @@ html .toggle-button.end.vertical svg {
}
.theme-dark .popover .preview-popup .arrow svg {
fill: var(--theme-content-color3);
fill: var(--theme-comment);
}
.tooltip {
@ -2504,7 +2508,7 @@ html .toggle-button.end.vertical svg {
.add-to-expression-bar .expression-to-save-button {
font-size: 14px;
color: var(--theme-content-color3);
color: var(--theme-comment);
}
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
@ -2575,7 +2579,6 @@ html .toggle-button.end.vertical svg {
background: var(--theme-toolbar-background);
border-top: 1px solid var(--theme-splitter-color);
border-bottom: 1px solid var(--theme-splitter-color);
padding-right: 16px;
}
.conditional-breakpoint-panel .prompt {
@ -2622,10 +2625,10 @@ html .toggle-button.end.vertical svg {
.editor-wrapper .CodeMirror-linewidget {
margin-right: -7px;
overflow: visible;
overflow: hidden;
}
.editor-wrapper .CodeMirror-sizer {
.editor-wrapper {
min-width: 0 !important;
}
@ -2759,7 +2762,7 @@ html[dir="rtl"] .editor-mount {
}
.theme-dark .editor-wrapper .CodeMirror-line .cm-comment {
color: var(--theme-content-color3);
color: var(--theme-comment);
}
.debug-expression {
@ -2811,7 +2814,7 @@ debug-expression-error {
@keyframes fade-highlight-out-dark {
0% {
background-color: var(--theme-content-color3);
background-color: var(--theme-comment);
}
100% {
background-color: transparent;
@ -2901,7 +2904,7 @@ html .breakpoints-list .breakpoint.paused {
}
.breakpoints-list .breakpoint.disabled .breakpoint-label {
color: var(--theme-content-color3);
color: var(--theme-comment);
transition: color 0.5s linear;
}
@ -3233,12 +3236,18 @@ html .breakpoints-list .breakpoint.paused {
color: white;
}
.show-more-container {
display: flex;
}
.show-more {
text-align: center;
padding: 8px 0px;
margin: 7px 10px 7px 7px;
border: 1px solid var(--theme-splitter-color);
background-color: var(--theme-tab-toolbar-background);
width: 100%;
font-size: inherit;
}
.show-more:hover {
@ -3585,7 +3594,7 @@ html[dir="rtl"] .dropdown {
}
.dropdown-button {
color: var(--theme-content-color3);
color: var(--theme-comment);
background: none;
border: none;
padding: 0;
@ -3702,6 +3711,14 @@ img.ignore-exceptions {
opacity: 0.6;
}
.object-node {
padding-left: 4px;
}
html[dir="rtl"] .object-node {
padding-right: 4px;
}
.object-label {
color: var(--theme-highlight-blue);
}
@ -3725,10 +3742,6 @@ img.ignore-exceptions {
overflow: auto;
}
.scopes-list {
padding-inline-start: 4px;
}
.scopes-list .tree:focus {
outline: none;
}
@ -3891,7 +3904,7 @@ html .welcomebox .toggle-button-end.collapsed {
padding: 4px;
margin-top: 4px;
margin-left: 2px;
fill: var(--theme-content-color3);
fill: var(--theme-comment);
transition: 0.1s ease;
align-self: center;
}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -30,6 +30,10 @@ support-files =
examples/babel/fixtures/switches/output.js.map
examples/babel/fixtures/try-catches/output.js
examples/babel/fixtures/try-catches/output.js.map
examples/babel/fixtures/webpack-modules/output.js
examples/babel/fixtures/webpack-modules/output.js.map
examples/babel/fixtures/webpack-modules-es6/output.js
examples/babel/fixtures/webpack-modules-es6/output.js.map
examples/sourcemaps/bundle.js
examples/sourcemaps/bundle.js.map
examples/sourcemaps2/main.min.js

Просмотреть файл

@ -12,7 +12,7 @@ add_task(async function() {
// Expand nodes and make sure more sources appear.
is(findAllElements(dbg, "sourceNodes").length, 2);
await clickElement(dbg, "sourceArrow", 2);
await clickElement(dbg, "sourceDirectoryLabel", 2);
is(findAllElements(dbg, "sourceNodes").length, 4);
await selectSource(dbg, "asm.js");

Просмотреть файл

@ -153,12 +153,22 @@ add_task(async function() {
]
);
await breakpointScopes(dbg, "imported-bindings", { line: 11, column: 2 }, [
// Babel 6's imports aren't fully mapped, so they show as unavailable.
// The call-based ones work, but the single-identifier ones do not.
await breakpointScopes(dbg, "imported-bindings", { line: 17, column: 2 }, [
"Module",
["aDefault", "(unavailable)"],
["aDefault2", '"a-default2"'],
["aDefault3", "(unavailable)"],
["anAliased", "(unavailable)"],
["anAliased2", '"an-original2"'],
["anAliased3", "(unavailable)"],
["aNamed", "(unavailable)"],
["aNamed2", '"a-named2"'],
["aNamed3", "(unavailable)"],
["aNamespace", "{\u2026}"],
["aNamespace2", "{\u2026}"],
["aNamespace3", "{\u2026}"],
"root()"
]);
@ -268,4 +278,38 @@ add_task(async function() {
"Module",
"root()"
]);
await breakpointScopes(dbg, "webpack-modules", { line: 17, column: 2 }, [
"Module",
["aDefault", '"a-default"'],
["aDefault2", '"a-default2"'],
["aDefault3", '"a-default3"'],
["anAliased", "Getter"],
["anAliased2", "Getter"],
["anAliased3", "Getter"],
["aNamed", "Getter"],
["aNamed2", "Getter"],
["aNamed3", "Getter"],
["aNamespace", "{\u2026}"],
["aNamespace2", "{\u2026}"],
["aNamespace3", "{\u2026}"],
"root()"
]);
await breakpointScopes(dbg, "webpack-modules-es6", { line: 17, column: 2 }, [
"Module",
["aDefault", '"a-default"'],
["aDefault2", '"a-default2"'],
["aDefault3", '"a-default3"'],
["anAliased", '"an-original"'],
["anAliased2", '"an-original2"'],
["anAliased3", '"an-original3"'],
["aNamed", '"a-named"'],
["aNamed2", '"a-named2"'],
["aNamed3", '"a-named3"'],
["aNamespace", "{\u2026}"],
["aNamespace2", "{\u2026}"],
["aNamespace3", "{\u2026}"],
"root()"
]);
});

Просмотреть файл

@ -28,7 +28,7 @@ async function assertTooltip(dbg, { result, expression }) {
is(preview.expression, expression, "Preview.expression");
}
async function assertPopup(dbg, { field, value, expression }) {
async function assertPreviewPopup(dbg, { field, value, expression }) {
const previewEl = await waitForElement(dbg, "popup");
const preview = dbg.selectors.getPreview(dbg.getState());
@ -61,6 +61,14 @@ add_task(async function() {
const popupPreviewed = waitForDispatch(dbg, "SET_PREVIEW");
hoverAtPos(dbg, { line: 2, ch: 10 });
await popupPreviewed;
await assertPopup(dbg, { field: "foo", value: "1", expression: "obj" });
await assertPopup(dbg, { field: "bar", value: "2", expression: "obj" });
await assertPreviewPopup(dbg, {
field: "foo",
value: "1",
expression: "obj"
});
await assertPreviewPopup(dbg, {
field: "bar",
value: "2",
expression: "obj"
});
});

Просмотреть файл

@ -83,7 +83,6 @@ add_task(async function() {
is(resultCount(dbg), 2, "two function results");
type(dbg, "@x");
await waitForTime(1000);
is(resultCount(dbg), 0, "no functions with 'x' in name");
pressKey(dbg, "Escape");
@ -96,7 +95,7 @@ add_task(async function() {
quickOpen(dbg, "#");
is(resultCount(dbg), 1, "one variable result");
const results = findAllElements(dbg, "resultItems");
results.forEach(result => is(result.textContent, "13"));
results.forEach(result => is(result.textContent, "x13"));
await waitToClose(dbg);
info("Testing goto line:column");

Просмотреть файл

@ -30,31 +30,27 @@ add_task(async function() {
// Expand nodes and make sure more sources appear.
await assertSourceCount(dbg, 2);
await clickElement(dbg, "sourceArrow", 2);
await clickElement(dbg, "sourceDirectoryLabel", 2);
await assertSourceCount(dbg, 7);
await clickElement(dbg, "sourceArrow", 3);
await clickElement(dbg, "sourceDirectoryLabel", 3);
await assertSourceCount(dbg, 8);
// Select a source
ok(
!findElementWithSelector(dbg, ".sources-list .focused"),
"Source is not focused"
);
const selected = waitForDispatch(dbg, "SELECT_SOURCE");
await clickElement(dbg, "sourceNode", 4);
await selected;
await waitForSelectedSource(dbg);
// Ensure the source file clicked is now focused
await waitForElementWithSelector(dbg, ".sources-list .focused");
const focusedNode = findElementWithSelector(dbg, ".sources-list .focused");
const fourthNode = findElement(dbg, "sourceNode", 4);
const selectedSource = getSelectedSource(getState()).get("url");
ok(fourthNode.classList.contains("focused"), "4th node is focused");
ok(
findElementWithSelector(dbg, ".sources-list .focused"),
"Source is focused"
);
ok(
getSelectedSource(getState())
.get("url")
.includes("nested-source.js"),
selectedSource.includes("nested-source.js"),
"The right source is selected"
);

Просмотреть файл

@ -1 +1 @@
{"version":3,"sources":["webpack:///webpack/bootstrap ffb963fac42d81060378","webpack:///./fixtures/commonjs/input.js"],"names":["moduleScoped","alsoModuleScoped","thirdModuleScoped","module","exports","console","log"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;AC7DA,IAAIA,eAAe,CAAnB;AACA,IAAIC,mBAAmB,CAAvB;;AAEA,SAASC,iBAAT,GAA4B,CAAE;;AAE9BC,OAAOC,OAAP,GAAiB,YAAW;AAC1BC,UAAQC,GAAR,CAAY,YAAZ,EAA0BN,YAA1B,EAAwCC,gBAAxC,EAA0DC,iBAA1D;AACD,CAFD,C","file":"fixtures/commonjs/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ffb963fac42d81060378","var moduleScoped = 1;\nlet alsoModuleScoped = 2;\n\nfunction thirdModuleScoped(){}\n\nmodule.exports = function() {\n console.log(\"pause here\", moduleScoped, alsoModuleScoped, thirdModuleScoped);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/commonjs/input.js"],"sourceRoot":""}
{"version":3,"sources":["webpack:///webpack/bootstrap ffb963fac42d81060378","webpack:///./fixtures/commonjs/input.js"],"names":["moduleScoped","alsoModuleScoped","thirdModuleScoped","module","exports","console","log"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;AC7DA,IAAIA,eAAe,CAAnB;AACA,IAAIC,mBAAmB,CAAvB;;AAEA,SAASC,iBAAT,GAA6B,CAAE;;AAE/BC,OAAOC,OAAP,GAAiB,YAAW;AAC1BC,UAAQC,GAAR,CAAY,YAAZ,EAA0BN,YAA1B,EAAwCC,gBAAxC,EAA0DC,iBAA1D;AACD,CAFD,C","file":"fixtures/commonjs/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ffb963fac42d81060378","var moduleScoped = 1;\nlet alsoModuleScoped = 2;\n\nfunction thirdModuleScoped() {}\n\nmodule.exports = function() {\n console.log(\"pause here\", moduleScoped, alsoModuleScoped, thirdModuleScoped);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/commonjs/input.js"],"sourceRoot":""}

Просмотреть файл

@ -1,7 +1,8 @@
export default function root() {
function decl(p1) {
const inner = function inner(p2) {
const arrow = p3 => {
const arrow = (p3) => {
console.log("pause here", p3, arrow, p2, inner, p1, decl, root);
};
arrow();

Просмотреть файл

@ -1 +1 @@
{"version":3,"sources":["webpack:///webpack/bootstrap bbb56a0ddd61e0c9076a","webpack:///./fixtures/functions/input.js"],"names":["root","decl","p1","inner","p2","arrow","p3","console","log"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;kBC7DwBA,I;AAAT,SAASA,IAAT,GAAgB;;AAE7B,WAASC,IAAT,CAAcC,EAAd,EAAiB;AACf,QAAMC,QAAQ,SAASA,KAAT,CAAeC,EAAf,EAAmB;AAC/B,UAAMC,QAAQ,SAARA,KAAQ,CAACC,EAAD,EAAQ;AACpBC,gBAAQC,GAAR,CAAY,YAAZ,EAA0BF,EAA1B,EAA8BD,KAA9B,EAAqCD,EAArC,EAAyCD,KAAzC,EAAgDD,EAAhD,EAAoDD,IAApD,EAA0DD,IAA1D;AACD,OAFD;AAGAK;AACD,KALD;AAMAF;AACD;;AAEDF;AACD","file":"fixtures/functions/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap bbb56a0ddd61e0c9076a","export default function root() {\n\n function decl(p1){\n const inner = function inner(p2) {\n const arrow = (p3) => {\n console.log(\"pause here\", p3, arrow, p2, inner, p1, decl, root);\n };\n arrow();\n };\n inner();\n }\n\n decl();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/functions/input.js"],"sourceRoot":""}
{"version":3,"sources":["webpack:///webpack/bootstrap bbb56a0ddd61e0c9076a","webpack:///./fixtures/functions/input.js"],"names":["root","decl","p1","inner","p2","arrow","p3","console","log"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;kBC7DwBA,I;AAAT,SAASA,IAAT,GAAgB;;AAE7B,WAASC,IAAT,CAAcC,EAAd,EAAkB;AAChB,QAAMC,QAAQ,SAASA,KAAT,CAAeC,EAAf,EAAmB;AAC/B,UAAMC,QAAQ,SAARA,KAAQ,CAACC,EAAD,EAAQ;AACpBC,gBAAQC,GAAR,CAAY,YAAZ,EAA0BF,EAA1B,EAA8BD,KAA9B,EAAqCD,EAArC,EAAyCD,KAAzC,EAAgDD,EAAhD,EAAoDD,IAApD,EAA0DD,IAA1D;AACD,OAFD;AAGAK;AACD,KALD;AAMAF;AACD;;AAEDF;AACD","file":"fixtures/functions/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap bbb56a0ddd61e0c9076a","export default function root() {\n\n function decl(p1) {\n const inner = function inner(p2) {\n const arrow = (p3) => {\n console.log(\"pause here\", p3, arrow, p2, inner, p1, decl, root);\n };\n arrow();\n };\n inner();\n }\n\n decl();\n}\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/functions/input.js"],"sourceRoot":""}

Просмотреть файл

@ -3,10 +3,38 @@ import { aNamed } from "./src/mod2";
import { original as anAliased } from "./src/mod3";
import * as aNamespace from "./src/mod4";
import aDefault2 from "./src/mod5";
import { aNamed2 } from "./src/mod6";
import { original as anAliased2 } from "./src/mod7";
import * as aNamespace2 from "./src/mod8";
import aDefault3 from "./src/mod9";
import { aNamed3 } from "./src/mod10";
import { original as anAliased3 } from "./src/mod11";
import * as aNamespace3 from "./src/mod12";
export default function root() {
console.log("pause here", root);
console.log(aDefault);
console.log(anAliased);
console.log(aNamed);
console.log(anAliased);
console.log(aNamespace);
console.log("pause here", root);
try {
// None of these are callable in this code, but we still want to make sure
// they map properly even if the only reference is in a call expressions.
console.log(aDefault2());
console.log(anAliased2());
console.log(aNamed2());
console.log(anAliased2());
console.log(aNamespace2());
console.log(new aDefault3());
console.log(new anAliased3());
console.log(new aNamed3());
console.log(new anAliased3());
console.log(new aNamespace3());
} catch (e) {}
}

Просмотреть файл

@ -88,16 +88,58 @@ var _mod5 = __webpack_require__(4);
var aNamespace = _interopRequireWildcard(_mod5);
var _mod6 = __webpack_require__(5);
var _mod7 = _interopRequireDefault(_mod6);
var _mod8 = __webpack_require__(6);
var _mod9 = __webpack_require__(7);
var _mod10 = __webpack_require__(8);
var aNamespace2 = _interopRequireWildcard(_mod10);
var _mod11 = __webpack_require__(9);
var _mod12 = _interopRequireDefault(_mod11);
var _mod13 = __webpack_require__(10);
var _mod14 = __webpack_require__(11);
var _mod15 = __webpack_require__(12);
var aNamespace3 = _interopRequireWildcard(_mod15);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function root() {
console.log("pause here", root);
console.log(_mod2.default);
console.log(_mod4.original);
console.log(_mod3.aNamed);
console.log(_mod4.original);
console.log(aNamespace);
console.log("pause here", root);
try {
// None of these are callable in this code, but we still want to make sure
// they map properly even if the only reference is in a call expressions.
console.log((0, _mod7.default)());
console.log((0, _mod9.original)());
console.log((0, _mod8.aNamed2)());
console.log((0, _mod9.original)());
console.log(aNamespace2());
console.log(new _mod12.default());
console.log(new _mod14.original());
console.log(new _mod13.aNamed3());
console.log(new _mod14.original());
console.log(new aNamespace3());
} catch (e) {}
}
module.exports = exports["default"];
@ -151,6 +193,106 @@ Object.defineProperty(exports, "__esModule", {
exports.default = "a-default";
var aNamed = exports.aNamed = "a-named";
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = "a-default2";
module.exports = exports["default"];
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var aNamed2 = exports.aNamed2 = "a-named2";
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var original = exports.original = "an-original2";
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = "a-default2";
var aNamed = exports.aNamed = "a-named2";
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = "a-default3";
module.exports = exports["default"];
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var aNamed3 = exports.aNamed3 = "a-named3";
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var original = exports.original = "an-original3";
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = "a-default3";
var aNamed = exports.aNamed = "a-named3";
/***/ })
/******/ ]);
//# sourceMappingURL=output.js.map

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -0,0 +1 @@
export const aNamed3 = "a-named3";

Просмотреть файл

@ -0,0 +1 @@
export const original = "an-original3";

Просмотреть файл

@ -0,0 +1,2 @@
export default "a-default3";
export const aNamed = "a-named3";

Просмотреть файл

@ -0,0 +1 @@
export default "a-default2";

Просмотреть файл

@ -0,0 +1 @@
export const aNamed2 = "a-named2";

Просмотреть файл

@ -0,0 +1 @@
export const original = "an-original2";

Просмотреть файл

@ -0,0 +1,2 @@
export default "a-default2";
export const aNamed = "a-named2";

Просмотреть файл

@ -0,0 +1 @@
export default "a-default3";

Просмотреть файл

@ -84,7 +84,6 @@ var alsoModuleScoped = 2;
function thirdModuleScoped() {}
;
module.exports = exports["default"];
/***/ })

Просмотреть файл

@ -1 +1 @@
{"version":3,"sources":["webpack:///webpack/bootstrap a5b39609b2c25f5afa32","webpack:///./fixtures/modules/input.js"],"names":["console","log","moduleScoped","alsoModuleScoped","thirdModuleScoped"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;;kBCxDe,YAAW;AACxBA,UAAQC,GAAR,CAAY,YAAZ,EAA0BC,YAA1B,EAAwCC,gBAAxC,EAA0DC,iBAA1D;AACD,C;;AAPD,IAAIF,eAAe,CAAnB;AACA,IAAIC,mBAAmB,CAAvB;;AAEA,SAASC,iBAAT,GAA4B,CAAE;;AAI7B","file":"fixtures/modules/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap a5b39609b2c25f5afa32","var moduleScoped = 1;\nlet alsoModuleScoped = 2;\n\nfunction thirdModuleScoped(){}\n\nexport default function() {\n console.log(\"pause here\", moduleScoped, alsoModuleScoped, thirdModuleScoped);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/modules/input.js"],"sourceRoot":""}
{"version":3,"sources":["webpack:///webpack/bootstrap 9b9a58c4024fd01afcf0","webpack:///./fixtures/modules/input.js"],"names":["console","log","moduleScoped","alsoModuleScoped","thirdModuleScoped"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;;kBCxDe,YAAW;AACxBA,UAAQC,GAAR,CAAY,YAAZ,EAA0BC,YAA1B,EAAwCC,gBAAxC,EAA0DC,iBAA1D;AACD,C;;AAPD,IAAIF,eAAe,CAAnB;AACA,IAAIC,mBAAmB,CAAvB;;AAEA,SAASC,iBAAT,GAA6B,CAAE","file":"fixtures/modules/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9b9a58c4024fd01afcf0","var moduleScoped = 1;\nlet alsoModuleScoped = 2;\n\nfunction thirdModuleScoped() {}\n\nexport default function() {\n console.log(\"pause here\", moduleScoped, alsoModuleScoped, thirdModuleScoped);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/modules/input.js"],"sourceRoot":""}

Просмотреть файл

@ -78,7 +78,7 @@ function thirdModuleScoped() {}
function nonModules() {
console.log("pause here");
};
}
Promise.resolve().then(function () {
// Webpack sets this to undefined initially since this file

Просмотреть файл

@ -1 +1 @@
{"version":3,"sources":["webpack:///webpack/bootstrap a2d9a17a8696aa8c4f17","webpack:///./fixtures/non-modules/input.js"],"names":["moduleScoped","alsoModuleScopes","thirdModuleScoped","nonModules","console","log","Promise","resolve","then","window"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;AC7DA,IAAIA,eAAe,CAAnB;AACA,IAAIC,mBAAmB,CAAvB;;AAEA,SAASC,iBAAT,GAA4B,CAAE;;AAE9B,SAASC,UAAT,GAAsB;AACpBC,UAAQC,GAAR,CAAY,YAAZ;AACD;;AAEDC,QAAQC,OAAR,GAAkBC,IAAlB,CAAuB,YAAM;AAC3B;AACA;AACAC,SAAON,UAAP,GAAoBA,UAApB;AACD,CAJD,E","file":"fixtures/non-modules/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap a2d9a17a8696aa8c4f17","var moduleScoped = 1;\nlet alsoModuleScopes = 2;\n\nfunction thirdModuleScoped(){}\n\nfunction nonModules() {\n console.log(\"pause here\");\n};\n\nPromise.resolve().then(() => {\n // Webpack sets this to undefined initially since this file\n // doesn't export anything, so we overwrite it on the next tick.\n window.nonModules = nonModules;\n})\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/non-modules/input.js"],"sourceRoot":""}
{"version":3,"sources":["webpack:///webpack/bootstrap 043cfddbb224a4258f85","webpack:///./fixtures/non-modules/input.js"],"names":["moduleScoped","alsoModuleScopes","thirdModuleScoped","nonModules","console","log","Promise","resolve","then","window"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;AC7DA,IAAIA,eAAe,CAAnB;AACA,IAAIC,mBAAmB,CAAvB;;AAEA,SAASC,iBAAT,GAA6B,CAAE;;AAE/B,SAASC,UAAT,GAAsB;AACpBC,UAAQC,GAAR,CAAY,YAAZ;AACD;;AAEDC,QAAQC,OAAR,GAAkBC,IAAlB,CAAuB,YAAM;AAC3B;AACA;AACAC,SAAON,UAAP,GAAoBA,UAApB;AACD,CAJD,E","file":"fixtures/non-modules/output.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 043cfddbb224a4258f85","var moduleScoped = 1;\nlet alsoModuleScopes = 2;\n\nfunction thirdModuleScoped() {}\n\nfunction nonModules() {\n console.log(\"pause here\");\n}\n\nPromise.resolve().then(() => {\n // Webpack sets this to undefined initially since this file\n // doesn't export anything, so we overwrite it on the next tick.\n window.nonModules = nonModules;\n});\n\n\n\n// WEBPACK FOOTER //\n// ./fixtures/non-modules/input.js"],"sourceRoot":""}

Просмотреть файл

@ -0,0 +1,45 @@
import aDefault from "./src/mod1";
import { aNamed } from "./src/mod2";
import { original as anAliased } from "./src/mod3";
import * as aNamespace from "./src/mod4";
import aDefault2 from "./src/mod5";
import { aNamed2 } from "./src/mod6";
import { original as anAliased2 } from "./src/mod7";
import * as aNamespace2 from "./src/mod8";
import aDefault3 from "./src/mod9";
import { aNamed3 } from "./src/mod10";
import { original as anAliased3 } from "./src/mod11";
import * as aNamespace3 from "./src/mod12";
export default function root() {
console.log("pause here", root);
console.log(aDefault);
console.log(anAliased);
console.log(aNamed);
console.log(anAliased);
console.log(aNamespace);
try {
// None of these are callable in this code, but we still want to make sure
// they map properly even if the only reference is in a call expressions.
console.log(aDefault2());
console.log(anAliased2());
console.log(aNamed2());
console.log(anAliased2());
console.log(aNamespace2());
console.log(new aDefault3());
console.log(new anAliased3());
console.log(new aNamed3());
console.log(new anAliased3());
console.log(new aNamespace3());
} catch (e) {}
}
// The build harness sets the wrong global, so just override it.
Promise.resolve().then(() => {
window.webpackModulesEs6 = root;
});

Просмотреть файл

@ -0,0 +1,242 @@
var webpackModulesEs6 =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (immutable) */ __webpack_exports__["default"] = root;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_mod1__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__src_mod2__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__src_mod3__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__src_mod4__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__src_mod5__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__src_mod6__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__src_mod7__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__src_mod8__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__src_mod9__ = __webpack_require__(9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__src_mod10__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__src_mod11__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__src_mod12__ = __webpack_require__(12);
function root() {
console.log("pause here", root);
console.log(__WEBPACK_IMPORTED_MODULE_0__src_mod1__["a" /* default */]);
console.log(__WEBPACK_IMPORTED_MODULE_2__src_mod3__["a" /* original */]);
console.log(__WEBPACK_IMPORTED_MODULE_1__src_mod2__["a" /* aNamed */]);
console.log(__WEBPACK_IMPORTED_MODULE_2__src_mod3__["a" /* original */]);
console.log(__WEBPACK_IMPORTED_MODULE_3__src_mod4__);
try {
// None of these are callable in this code, but we still want to make sure
// they map properly even if the only reference is in a call expressions.
console.log(Object(__WEBPACK_IMPORTED_MODULE_4__src_mod5__["a" /* default */])());
console.log(Object(__WEBPACK_IMPORTED_MODULE_6__src_mod7__["a" /* original */])());
console.log(Object(__WEBPACK_IMPORTED_MODULE_5__src_mod6__["a" /* aNamed2 */])());
console.log(Object(__WEBPACK_IMPORTED_MODULE_6__src_mod7__["a" /* original */])());
console.log(__WEBPACK_IMPORTED_MODULE_7__src_mod8__());
console.log(new __WEBPACK_IMPORTED_MODULE_8__src_mod9__["a" /* default */]());
console.log(new __WEBPACK_IMPORTED_MODULE_10__src_mod11__["a" /* original */]());
console.log(new __WEBPACK_IMPORTED_MODULE_9__src_mod10__["a" /* aNamed3 */]());
console.log(new __WEBPACK_IMPORTED_MODULE_10__src_mod11__["a" /* original */]());
console.log(new __WEBPACK_IMPORTED_MODULE_11__src_mod12__());
} catch (e) {}
}
// The build harness sets the wrong global, so just override it.
Promise.resolve().then(() => {
window.webpackModulesEs6 = root;
});
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = ("a-default");
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
const aNamed = "a-named";
/* harmony export (immutable) */ __webpack_exports__["a"] = aNamed;
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
const original = "an-original";
/* harmony export (immutable) */ __webpack_exports__["a"] = original;
/***/ }),
/* 4 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony default export */ __webpack_exports__["default"] = ("a-default");
const aNamed = "a-named";
/* harmony export (immutable) */ __webpack_exports__["aNamed"] = aNamed;
/***/ }),
/* 5 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = ("a-default2");
/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
const aNamed2 = "a-named2";
/* harmony export (immutable) */ __webpack_exports__["a"] = aNamed2;
/***/ }),
/* 7 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
const original = "an-original2";
/* harmony export (immutable) */ __webpack_exports__["a"] = original;
/***/ }),
/* 8 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony default export */ __webpack_exports__["default"] = ("a-default2");
const aNamed = "a-named2";
/* harmony export (immutable) */ __webpack_exports__["aNamed"] = aNamed;
/***/ }),
/* 9 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = ("a-default3");
/***/ }),
/* 10 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
const aNamed3 = "a-named3";
/* harmony export (immutable) */ __webpack_exports__["a"] = aNamed3;
/***/ }),
/* 11 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
const original = "an-original3";
/* harmony export (immutable) */ __webpack_exports__["a"] = original;
/***/ }),
/* 12 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony default export */ __webpack_exports__["default"] = ("a-default3");
const aNamed = "a-named3";
/* harmony export (immutable) */ __webpack_exports__["aNamed"] = aNamed;
/***/ })
/******/ ]);
//# sourceMappingURL=output.js.map

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -0,0 +1 @@
export default "a-default";

Просмотреть файл

@ -0,0 +1 @@
export const aNamed3 = "a-named3";

Просмотреть файл

@ -0,0 +1 @@
export const original = "an-original3";

Просмотреть файл

@ -0,0 +1,2 @@
export default "a-default3";
export const aNamed = "a-named3";

Просмотреть файл

@ -0,0 +1 @@
export const aNamed = "a-named";

Просмотреть файл

@ -0,0 +1 @@
export const original = "an-original";

Просмотреть файл

@ -0,0 +1,2 @@
export default "a-default";
export const aNamed = "a-named";

Просмотреть файл

@ -0,0 +1 @@
export default "a-default2";

Просмотреть файл

@ -0,0 +1 @@
export const aNamed2 = "a-named2";

Просмотреть файл

@ -0,0 +1 @@
export const original = "an-original2";

Просмотреть файл

@ -0,0 +1,2 @@
export default "a-default2";
export const aNamed = "a-named2";

Просмотреть файл

@ -0,0 +1 @@
export default "a-default3";

Просмотреть файл

@ -0,0 +1,45 @@
import aDefault from "./src/mod1";
import { aNamed } from "./src/mod2";
import { original as anAliased } from "./src/mod3";
import * as aNamespace from "./src/mod4";
import aDefault2 from "./src/mod5";
import { aNamed2 } from "./src/mod6";
import { original as anAliased2 } from "./src/mod7";
import * as aNamespace2 from "./src/mod8";
import aDefault3 from "./src/mod9";
import { aNamed3 } from "./src/mod10";
import { original as anAliased3 } from "./src/mod11";
import * as aNamespace3 from "./src/mod12";
export default function root() {
console.log("pause here", root);
console.log(aDefault);
console.log(anAliased);
console.log(aNamed);
console.log(anAliased);
console.log(aNamespace);
try {
// None of these are callable in this code, but we still want to make sure
// they map properly even if the only reference is in a call expressions.
console.log(aDefault2());
console.log(anAliased2());
console.log(aNamed2());
console.log(anAliased2());
console.log(aNamespace2());
console.log(new aDefault3());
console.log(new anAliased3());
console.log(new aNamed3());
console.log(new anAliased3());
console.log(new aNamespace3());
} catch (e) {}
}
// The build harness sets the wrong global, so just override it.
Promise.resolve().then(() => {
window.webpackModules = root;
});

Просмотреть файл

@ -0,0 +1,233 @@
var webpackModules =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (immutable) */ __webpack_exports__["default"] = root;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_mod1__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__src_mod2__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__src_mod3__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__src_mod4__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__src_mod5__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__src_mod6__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__src_mod7__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__src_mod8__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__src_mod9__ = __webpack_require__(9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__src_mod10__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__src_mod11__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__src_mod12__ = __webpack_require__(12);
function root() {
console.log("pause here", root);
console.log(__WEBPACK_IMPORTED_MODULE_0__src_mod1__["a" /* default */]);
console.log(__WEBPACK_IMPORTED_MODULE_2__src_mod3__["a" /* original */]);
console.log(__WEBPACK_IMPORTED_MODULE_1__src_mod2__["a" /* aNamed */]);
console.log(__WEBPACK_IMPORTED_MODULE_2__src_mod3__["a" /* original */]);
console.log(__WEBPACK_IMPORTED_MODULE_3__src_mod4__);
try {
// None of these are callable in this code, but we still want to make sure
// they map properly even if the only reference is in a call expressions.
console.log(Object(__WEBPACK_IMPORTED_MODULE_4__src_mod5__["a" /* default */])());
console.log(Object(__WEBPACK_IMPORTED_MODULE_6__src_mod7__["a" /* original */])());
console.log(Object(__WEBPACK_IMPORTED_MODULE_5__src_mod6__["a" /* aNamed2 */])());
console.log(Object(__WEBPACK_IMPORTED_MODULE_6__src_mod7__["a" /* original */])());
console.log(__WEBPACK_IMPORTED_MODULE_7__src_mod8__());
console.log(new __WEBPACK_IMPORTED_MODULE_8__src_mod9__["a" /* default */]());
console.log(new __WEBPACK_IMPORTED_MODULE_10__src_mod11__["a" /* original */]());
console.log(new __WEBPACK_IMPORTED_MODULE_9__src_mod10__["a" /* aNamed3 */]());
console.log(new __WEBPACK_IMPORTED_MODULE_10__src_mod11__["a" /* original */]());
console.log(new __WEBPACK_IMPORTED_MODULE_11__src_mod12__());
} catch (e) {}
}
// The build harness sets the wrong global, so just override it.
Promise.resolve().then(function () {
window.webpackModules = root;
});
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = ("a-default");
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return aNamed; });
var aNamed = "a-named";
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return original; });
var original = "an-original";
/***/ }),
/* 4 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "aNamed", function() { return aNamed; });
/* harmony default export */ __webpack_exports__["default"] = ("a-default");
var aNamed = "a-named";
/***/ }),
/* 5 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = ("a-default2");
/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return aNamed2; });
var aNamed2 = "a-named2";
/***/ }),
/* 7 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return original; });
var original = "an-original2";
/***/ }),
/* 8 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "aNamed", function() { return aNamed; });
/* harmony default export */ __webpack_exports__["default"] = ("a-default2");
var aNamed = "a-named2";
/***/ }),
/* 9 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = ("a-default3");
/***/ }),
/* 10 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return aNamed3; });
var aNamed3 = "a-named3";
/***/ }),
/* 11 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return original; });
var original = "an-original3";
/***/ }),
/* 12 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "aNamed", function() { return aNamed; });
/* harmony default export */ __webpack_exports__["default"] = ("a-default3");
var aNamed = "a-named3";
/***/ })
/******/ ]);
//# sourceMappingURL=output.js.map

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -0,0 +1 @@
export default "a-default";

Просмотреть файл

@ -0,0 +1 @@
export const aNamed3 = "a-named3";

Просмотреть файл

@ -0,0 +1 @@
export const original = "an-original3";

Просмотреть файл

@ -0,0 +1,2 @@
export default "a-default3";
export const aNamed = "a-named3";

Просмотреть файл

@ -0,0 +1 @@
export const aNamed = "a-named";

Просмотреть файл

@ -0,0 +1 @@
export const original = "an-original";

Просмотреть файл

@ -0,0 +1,2 @@
export default "a-default";
export const aNamed = "a-named";

Просмотреть файл

@ -0,0 +1 @@
export default "a-default2";

Просмотреть файл

@ -0,0 +1 @@
export const aNamed2 = "a-named2";

Просмотреть файл

@ -0,0 +1 @@
export const original = "an-original2";

Просмотреть файл

@ -0,0 +1,2 @@
export default "a-default2";
export const aNamed = "a-named2";

Просмотреть файл

@ -0,0 +1 @@
export default "a-default3";

Просмотреть файл

@ -38,29 +38,36 @@ fs.writeFileSync(
)
);
module.exports = tests.map(({ name, dirname, input, output }) => ({
context: __dirname,
entry: input,
output: {
path: __dirname,
filename: output,
module.exports = tests.map(({ name, dirname, input, output }) => {
const babelEnv = name !== "webpackModulesEs6";
const babelModules = name !== "webpackModules";
libraryTarget: "var",
library: name
},
devtool: "sourcemap",
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
options: {
babelrc: false,
presets: ["env"],
plugins: ["add-module-exports"]
return {
context: __dirname,
entry: input,
output: {
path: __dirname,
filename: output,
libraryTarget: "var",
library: name
},
devtool: "sourcemap",
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
options: {
babelrc: false,
presets: babelEnv
? [["env", { modules: babelModules ? "commonjs" : false }]]
: [],
plugins: babelEnv && babelModules ? ["add-module-exports"] : []
}
}
}
]
}
}));
]
}
};
});

Просмотреть файл

@ -36,6 +36,10 @@
<button onclick="thisArgumentsBindings()">Run thisArgumentsBindings</button>
<script src="babel/fixtures/try-catches/output.js"></script>
<button onclick="tryCatches()">Run tryCatches</button>
<script src="babel/fixtures/webpack-modules/output.js"></script>
<button onclick="webpackModules()">Run webpackModules</button>
<script src="babel/fixtures/webpack-modules-es6/output.js"></script>
<button onclick="webpackModulesEs6()">Run webpackModulesEs6</button>
<!-- INJECTED-END -->
</body>
</html>

Просмотреть файл

@ -943,7 +943,7 @@ const selectors = {
editorFooter: ".editor-pane .source-footer",
sourceNode: i => `.sources-list .tree-node:nth-child(${i}) .node`,
sourceNodes: ".sources-list .tree-node",
sourceArrow: i => `.sources-list .tree-node:nth-child(${i}) .arrow`,
sourceDirectoryLabel: i => `.sources-list .tree-node:nth-child(${i}) .label`,
resultItems: ".result-list .result-item",
fileMatch: ".managed-tree .result",
popup: ".popover",

Просмотреть файл

@ -48,6 +48,10 @@ copyStackTrace.accesskey=c
# that expands the left and right panes in the debugger UI.
expandPanes=Expand panes
# LOCALIZATION NOTE (evaluateInConsole.label): Editor right-click menu item
# to execute selected text in browser console.
evaluateInConsole.label=Evaluate in console
# LOCALIZATION NOTE (pauseButtonTooltip): The tooltip that is displayed for the pause
# button when the debugger is in a running state.
pauseButtonTooltip=Pause %S

Просмотреть файл

@ -1,13 +1,13 @@
# wasmparser version
Current vesion is: 0.5.2
Current vesion is: 0.5.3
# Upgrade process
1. Pull latest release from npm and extract WasmDis.js and WasmParser.js, e.g.
```
curl https://registry.npmjs.org/wasmparser/-/wasmparser-0.5.2.tgz | tar -x --strip-components 2 package/dist/{WasmDis,WasmParser}.js
curl https://registry.npmjs.org/wasmparser/-/wasmparser-0.5.3.tgz | tar -x --strip-components 2 package/dist/{WasmDis,WasmParser}.js
```
2. Remove reference to source maps (last line)

12
devtools/client/shared/vendor/WasmDis.js поставляемый
Просмотреть файл

@ -201,7 +201,7 @@ function getOperatorName(code) {
}
return operatorCodeNamesCache[code];
}
var DefaultNameResolver = (function () {
var DefaultNameResolver = /** @class */ (function () {
function DefaultNameResolver() {
}
DefaultNameResolver.prototype.getTypeName = function (index, isRef) {
@ -229,7 +229,7 @@ var DefaultNameResolver = (function () {
return DefaultNameResolver;
}());
exports.DefaultNameResolver = DefaultNameResolver;
var NumericNameResolver = (function () {
var NumericNameResolver = /** @class */ (function () {
function NumericNameResolver() {
}
NumericNameResolver.prototype.getTypeName = function (index, isRef) {
@ -256,7 +256,7 @@ var NumericNameResolver = (function () {
return NumericNameResolver;
}());
exports.NumericNameResolver = NumericNameResolver;
var LineBuffer = (function () {
var LineBuffer = /** @class */ (function () {
function LineBuffer() {
this._firstPart = '';
this._secondPart = '';
@ -325,7 +325,7 @@ var LabelMode;
LabelMode[LabelMode["WhenUsed"] = 1] = "WhenUsed";
LabelMode[LabelMode["Always"] = 2] = "Always";
})(LabelMode = exports.LabelMode || (exports.LabelMode = {}));
var WasmDisassembler = (function () {
var WasmDisassembler = /** @class */ (function () {
function WasmDisassembler() {
this._lines = [];
this._offsets = [];
@ -421,7 +421,7 @@ var WasmDisassembler = (function () {
for (var i = 0; i < b.length; i++) {
var byte = b[i];
if (byte < 0x20 || byte >= 0x7F ||
byte == 0x22 || byte == 0x5c) {
byte == /* " */ 0x22 || byte == /* \ */ 0x5c) {
this.appendBuffer('\\' + (byte >> 4).toString(16) + (byte & 15).toString(16));
}
else {
@ -450,7 +450,7 @@ var WasmDisassembler = (function () {
return backrefLabel.label || '' + depth;
};
WasmDisassembler.prototype.printOperator = function (operator) {
var code = operator.code | 0;
var code = operator.code;
this.appendBuffer(getOperatorName(code));
switch (code) {
case 2 /* block */:

8
devtools/client/shared/vendor/WasmParser.js поставляемый
Просмотреть файл

@ -381,7 +381,7 @@ var BinaryReaderState;
BinaryReaderState[BinaryReaderState["RELOC_SECTION_ENTRY"] = 42] = "RELOC_SECTION_ENTRY";
BinaryReaderState[BinaryReaderState["SOURCE_MAPPING_URL"] = 43] = "SOURCE_MAPPING_URL";
})(BinaryReaderState = exports.BinaryReaderState || (exports.BinaryReaderState = {}));
var DataRange = (function () {
var DataRange = /** @class */ (function () {
function DataRange(start, end) {
this.start = start;
this.end = end;
@ -392,7 +392,7 @@ var DataRange = (function () {
};
return DataRange;
}());
var Int64 = (function () {
var Int64 = /** @class */ (function () {
function Int64(data) {
this._data = data || new Uint8Array(8);
}
@ -424,7 +424,7 @@ var Int64 = (function () {
return Int64;
}());
exports.Int64 = Int64;
var BinaryReader = (function () {
var BinaryReader = /** @class */ (function () {
function BinaryReader() {
this._data = null;
this._pos = 0;
@ -1138,7 +1138,7 @@ var BinaryReader = (function () {
if (!this._eof && pos + MAX_CODE_OPERATOR_SIZE > this._length) {
return false;
}
var code = this._data[this._pos++] | 0;
var code = this._data[this._pos++];
var blockType, brDepth, brTable, funcIndex, typeIndex, localIndex, globalIndex, memoryAddress, literal, reserved;
switch (code) {
case 2 /* block */:

Просмотреть файл

@ -284,9 +284,6 @@ MediaDecoder::Shutdown()
DiscardOngoingSeekIfExists();
#ifdef NIGHTLY_BUILD
DUMP("[DEBUG SHUTDOWN] %s: decoder=%p state machine=%p", __func__, this, mDecoderStateMachine.get());
#endif
// This changes the decoder state to SHUTDOWN and does other things
// necessary to unblock the state machine thread if it's blocked, so
// the asynchronous shutdown in nsDestroyStateMachine won't deadlock.

Просмотреть файл

@ -86,12 +86,6 @@ using namespace mozilla::media;
#define SLOGW(x, ...) NS_WARNING(nsPrintfCString(SFMT(x, ##__VA_ARGS__)).get())
#define SLOGE(x, ...) NS_DebugBreak(NS_DEBUG_WARNING, nsPrintfCString(SFMT(x, ##__VA_ARGS__)).get(), nullptr, __FILE__, __LINE__)
#ifdef NIGHTLY_BUILD
#define DEBUG_SHUTDOWN(fmt, ...) printf_stderr("[DEBUG SHUTDOWN] %s: " fmt "\n", __func__, ##__VA_ARGS__)
#else
#define DEBUG_SHUTDOWN(...) do { } while (0)
#endif
// Certain constants get stored as member variables and then adjusted by various
// scale factors on a per-decoder basis. We want to make sure to avoid using these
// constants directly, so we put them in a namespace.
@ -2663,8 +2657,6 @@ ShutdownState::Enter()
// Shut down the watch manager to stop further notifications.
master->mWatchManager.Shutdown();
DEBUG_SHUTDOWN("state machine=%p reader=%p", this, Reader());
return Reader()->Shutdown()->Then(
OwnerThread(), __func__, master,
&MediaDecoderStateMachine::FinishShutdown,
@ -3499,7 +3491,6 @@ MediaDecoderStateMachine::FinishShutdown()
{
MOZ_ASSERT(OnTaskQueue());
LOG("Shutting down state machine task queue");
DEBUG_SHUTDOWN("state machine=%p", this);
return OwnerThread()->BeginShutdown();
}

Просмотреть файл

@ -46,12 +46,6 @@ mozilla::LazyLogModule gMediaDemuxerLog("MediaDemuxer");
#define NS_DispatchToMainThread(...) CompileError_UseAbstractMainThreadInstead
#ifdef NIGHTLY_BUILD
#define DEBUG_SHUTDOWN(fmt, ...) printf_stderr("[DEBUG SHUTDOWN] %s: " fmt "\n", __func__, ##__VA_ARGS__)
#else
#define DEBUG_SHUTDOWN(...) do { } while (0)
#endif
namespace mozilla {
@ -455,7 +449,6 @@ MediaFormatReader::ShutdownPromisePool::Shutdown()
{
MOZ_DIAGNOSTIC_ASSERT(!mShutdown);
mShutdown = true;
DEBUG_SHUTDOWN("pool=%p count=%d", this, mPromises.Count());
if (mPromises.Count() == 0) {
mOnShutdownComplete->Resolve(true, __func__);
}
@ -473,7 +466,6 @@ MediaFormatReader::ShutdownPromisePool::Track(RefPtr<ShutdownPromise> aPromise)
[aPromise, this]() {
MOZ_DIAGNOSTIC_ASSERT(mPromises.Contains(aPromise));
mPromises.RemoveEntry(aPromise);
DEBUG_SHUTDOWN("pool=%p shutdown=%s count=%d", this, mShutdown ? "true" : "false", mPromises.Count());
if (mShutdown && mPromises.Count() == 0) {
mOnShutdownComplete->Resolve(true, __func__);
}
@ -490,7 +482,6 @@ MediaFormatReader::DecoderData::ShutdownDecoder()
return;
}
DEBUG_SHUTDOWN("decoder: '%s' (%p) flush:%d", mDecoder->GetDescriptionName().get(), mDecoder.get(), mFlushing);
if (mFlushing) {
// Flush is is in action. Shutdown will be initiated after flush completes.
MOZ_DIAGNOSTIC_ASSERT(mShutdownPromise);
@ -1391,7 +1382,6 @@ MediaFormatReader::Shutdown()
ShutdownDecoder(TrackInfo::kVideoTrack);
}
DEBUG_SHUTDOWN("reader=%p shutdown demuxer=%p", this, mDemuxer.get());
mShutdownPromisePool->Track(mDemuxer->Shutdown());
mDemuxer = nullptr;
@ -1426,13 +1416,11 @@ MediaFormatReader::TearDownDecoders()
mAudio.mTaskQueue->BeginShutdown();
mAudio.mTaskQueue->AwaitShutdownAndIdle();
mAudio.mTaskQueue = nullptr;
DEBUG_SHUTDOWN("reader=%p shut down audio task queue", this);
}
if (mVideo.mTaskQueue) {
mVideo.mTaskQueue->BeginShutdown();
mVideo.mTaskQueue->AwaitShutdownAndIdle();
mVideo.mTaskQueue = nullptr;
DEBUG_SHUTDOWN("reader=%p shut down video task queue", this);
}
mDecoderFactory = nullptr;

Просмотреть файл

@ -19,12 +19,6 @@ extern LazyLogModule gMediaDecoderLog;
#define DECODER_LOG(type, msg) MOZ_LOG(gMediaDecoderLog, type, msg)
#define LOGW(...) NS_WARNING(nsPrintfCString(__VA_ARGS__).get())
#ifdef NIGHTLY_BUILD
#define DEBUG_SHUTDOWN(fmt, ...) printf_stderr("[DEBUG SHUTDOWN] %s: " fmt "\n", __func__, ##__VA_ARGS__)
#else
#define DEBUG_SHUTDOWN(...) do { } while (0)
#endif
NS_IMPL_ISUPPORTS(MediaShutdownManager, nsIAsyncShutdownBlocker)
MediaShutdownManager::MediaShutdownManager()
@ -124,7 +118,6 @@ MediaShutdownManager::Register(MediaDecoder* aDecoder)
// that's not going to work.
MOZ_ASSERT(!mDecoders.Contains(aDecoder));
mDecoders.PutEntry(aDecoder);
DEBUG_SHUTDOWN("decoder=%p, count=%d", aDecoder, mDecoders.Count());
MOZ_ASSERT(mDecoders.Contains(aDecoder));
MOZ_ASSERT(mDecoders.Count() > 0);
return NS_OK;
@ -138,7 +131,6 @@ MediaShutdownManager::Unregister(MediaDecoder* aDecoder)
return;
}
mDecoders.RemoveEntry(aDecoder);
DEBUG_SHUTDOWN("decoder=%p, count=%d", aDecoder, mDecoders.Count());
if (sInitPhase == XPCOMShutdownStarted && mDecoders.Count() == 0) {
RemoveBlocker();
}

Просмотреть файл

@ -19,12 +19,6 @@
#include <jni.h>
#ifdef NIGHTLY_BUILD
#define DEBUG_SHUTDOWN(fmt, ...) printf_stderr("[DEBUG SHUTDOWN] %s: " fmt "\n", __func__, ##__VA_ARGS__)
#else
#define DEBUG_SHUTDOWN(...) do { } while (0)
#endif
#undef LOG
#define LOG(arg, ...) \
MOZ_LOG(sAndroidDecoderModuleLog, \
@ -542,7 +536,6 @@ RemoteDataDecoder::ProcessShutdown()
mFormat = nullptr;
DEBUG_SHUTDOWN("decoder=%p mime=%s", this, mMimeType.get());
return ShutdownPromise::CreateAndResolve(true, __func__);
}

Просмотреть файл

@ -1,4 +1,4 @@
skip-if(Android) fuzzy-if(OSX,22,49977) skip-if(winWidget) fuzzy-if(gtkWidget&&layersGPUAccelerated,70,600) HTTP(..) == short.mp4.firstframe.html short.mp4.firstframe-ref.html
skip-if(Android) fuzzy-if(OSX,23,51392) fuzzy-if(winWidget,59,76797) fuzzy-if(gtkWidget&&layersGPUAccelerated,60,1800) HTTP(..) == short.mp4.lastframe.html short.mp4.lastframe-ref.html
skip-if(Android) skip-if(winWidget) fuzzy-if(gtkWidget&&layersGPUAccelerated,55,4281) fuzzy-if(OSX,3,111852) HTTP(..) == bipbop_300_215kbps.mp4.lastframe.html bipbop_300_215kbps.mp4.lastframe-ref.html
skip-if(Android) fuzzy-if(OSX,25,175921) fuzzy-if(winWidget,64,179198) HTTP(..) == gizmo.mp4.seek.html gizmo.mp4.55thframe-ref.html
skip-if(Android) fuzzy-if(OSX,25,175921) fuzzy-if(winWidget,71,179198) HTTP(..) == gizmo.mp4.seek.html gizmo.mp4.55thframe-ref.html

Просмотреть файл

@ -151,10 +151,7 @@ for (let type of ['f32', 'f64']) {
(export "" $foo)
)`,
WebAssembly.RuntimeError,
// Technically we have this one *one-instruction* interval where
// the caller is lost (the stack with "1,>"). It's annoying to fix and shouldn't
// mess up profiles in practice so we ignore it.
["", ">", "0,>", "1,0,>", "1,>", "trap handling,0,>", "", ">", ""]);
["", ">", "0,>", "1,0,>", ">", "", ">", ""]);
})();
(function() {

Просмотреть файл

@ -0,0 +1,34 @@
var mod = new WebAssembly.Module(wasmTextToBinary(`
(module
(func (export "func_0") (result i32)
call 0
)
)
`));
var g = newGlobal();
g.parent = this;
g.eval("(" + function() {
var dbg = Debugger(parent);
dbg.onEnterFrame = function(frame) {}
} + ")()");
processModule(mod);
processModule(mod);
processModule(mod);
processModule(mod);
mod = new WebAssembly.Module(wasmTextToBinary(`
(module (export "func_0" $func1) (func $func1))
`));
processModule(mod);
processModule(mod);
processModule(mod);
processModule(mod);
function processModule(module) {
try {
new WebAssembly.Instance(module).exports.func_0();
} catch(ex) {}
}

Просмотреть файл

@ -5075,11 +5075,8 @@ CodeGenerator::visitCallDirectEval(LCallDirectEval* lir)
}
void
CodeGenerator::generateArgumentsChecks(bool bailout)
CodeGenerator::generateArgumentsChecks(bool assert)
{
// Registers safe for use before generatePrologue().
static const uint32_t EntryTempMask = Registers::TempMask & ~(1 << OsrFrameReg.code());
// This function can be used the normal way to check the argument types,
// before entering the function and bailout when arguments don't match.
// For debug purpose, this is can also be used to force/check that the
@ -5089,7 +5086,7 @@ CodeGenerator::generateArgumentsChecks(bool bailout)
MResumePoint* rp = mir.entryResumePoint();
// No registers are allocated yet, so it's safe to grab anything.
Register temp = AllocatableGeneralRegisterSet(EntryTempMask).getAny();
Register temp = AllocatableGeneralRegisterSet(GeneralRegisterSet::All()).getAny();
const CompileInfo& info = gen->info();
@ -5110,9 +5107,8 @@ CodeGenerator::generateArgumentsChecks(bool bailout)
}
if (miss.used()) {
if (bailout) {
bailoutFrom(&miss, graph.entrySnapshot());
} else {
if (assert) {
#ifdef DEBUG
Label success;
masm.jump(&success);
masm.bind(&miss);
@ -5135,6 +5131,11 @@ CodeGenerator::generateArgumentsChecks(bool bailout)
masm.assumeUnreachable("Argument check fail.");
masm.bind(&success);
#else
MOZ_CRASH("Shouldn't get here in opt builds");
#endif
} else {
bailoutFrom(&miss, graph.entrySnapshot());
}
}
}
@ -5376,6 +5377,7 @@ CodeGenerator::branchIfInvalidated(Register temp, Label* invalidated)
invalidated);
}
#ifdef DEBUG
void
CodeGenerator::emitAssertObjectOrStringResult(Register input, MIRType type, const TemporaryTypeSet* typeset)
{
@ -5506,7 +5508,6 @@ CodeGenerator::emitAssertResultV(const ValueOperand input, const TemporaryTypeSe
masm.pop(temp1);
}
#ifdef DEBUG
void
CodeGenerator::emitObjectOrStringResultChecks(LInstruction* lir, MDefinition* mir)
{
@ -9891,7 +9892,7 @@ CodeGenerator::generate()
#ifdef DEBUG
// Assert that the argument types are correct.
generateArgumentsChecks(/* bailout = */ false);
generateArgumentsChecks(/* assert = */ true);
#endif
// Reset native => bytecode map table with top-level script and startPc.
@ -12558,17 +12559,24 @@ CodeGenerator::emitAssertRangeD(const Range* r, FloatRegister input, FloatRegist
void
CodeGenerator::visitAssertResultV(LAssertResultV* ins)
{
#ifdef DEBUG
const ValueOperand value = ToValue(ins, LAssertResultV::Input);
emitAssertResultV(value, ins->mirRaw()->resultTypeSet());
#else
MOZ_CRASH("LAssertResultV is debug only");
#endif
}
void
CodeGenerator::visitAssertResultT(LAssertResultT* ins)
{
#ifdef DEBUG
Register input = ToRegister(ins->input());
MDefinition* mir = ins->mirRaw();
emitAssertObjectOrStringResult(input, mir->type(), mir->resultTypeSet());
#else
MOZ_CRASH("LAssertResultT is debug only");
#endif
}
void

Просмотреть файл

@ -63,7 +63,7 @@ class OutOfLineNaNToZero;
class CodeGenerator final : public CodeGeneratorSpecific
{
void generateArgumentsChecks(bool bailout = true);
void generateArgumentsChecks(bool assert = false);
MOZ_MUST_USE bool generateBody();
ConstantOrRegister toConstantOrRegister(LInstruction* lir, size_t n, MIRType type);
@ -455,8 +455,11 @@ class CodeGenerator final : public CodeGeneratorSpecific
void visitAssertResultV(LAssertResultV* ins);
void visitAssertResultT(LAssertResultT* ins);
#ifdef DEBUG
void emitAssertResultV(const ValueOperand output, const TemporaryTypeSet* typeset);
void emitAssertObjectOrStringResult(Register input, MIRType type, const TemporaryTypeSet* typeset);
#endif
void visitInterruptCheck(LInterruptCheck* lir);
void visitOutOfLineInterruptCheckImplicit(OutOfLineInterruptCheckImplicit* ins);

Просмотреть файл

@ -4658,18 +4658,30 @@ LIRGenerator::visitWasmStackArg(MWasmStackArg* ins)
}
}
void
LIRGenerator::visitWasmCall(MWasmCall* ins)
template <typename LClass>
LInstruction*
LIRGenerator::lowerWasmCall(MWasmCall* ins, bool needsBoundsCheck)
{
LAllocation* args = gen->allocate<LAllocation>(ins->numOperands());
if (!args) {
auto* lir = new(alloc()) LClass(ins->numOperands(), needsBoundsCheck);
if (!lir->init(alloc())) {
abort(AbortReason::Alloc, "Couldn't allocate for MWasmCall");
return;
return nullptr;
}
for (unsigned i = 0; i < ins->numArgs(); i++)
args[i] = useFixedAtStart(ins->getOperand(i), ins->registerForArg(i));
lir->setOperand(i, useFixedAtStart(ins->getOperand(i), ins->registerForArg(i)));
if (ins->callee().isTable()) {
MDefinition* index = ins->getOperand(ins->numArgs());
lir->setOperand(ins->numArgs(), useFixedAtStart(index, WasmTableCallIndexReg));
}
return lir;
}
void
LIRGenerator::visitWasmCall(MWasmCall* ins)
{
bool needsBoundsCheck = true;
if (ins->callee().isTable()) {
MDefinition* index = ins->getOperand(ins->numArgs());
@ -4678,17 +4690,17 @@ LIRGenerator::visitWasmCall(MWasmCall* ins)
if (uint32_t(index->toConstant()->toInt32()) < ins->callee().wasmTableMinLength())
needsBoundsCheck = false;
}
args[ins->numArgs()] = useFixedAtStart(index, WasmTableCallIndexReg);
}
LInstruction* lir;
if (ins->type() == MIRType::Int64)
lir = new(alloc()) LWasmCallI64(args, ins->numOperands(), needsBoundsCheck);
lir = lowerWasmCall<LWasmCallI64>(ins, needsBoundsCheck);
else if (ins->type() == MIRType::None)
lir = new(alloc()) LWasmCallVoid(args, ins->numOperands(), needsBoundsCheck);
lir = lowerWasmCall<LWasmCallVoid>(ins, needsBoundsCheck);
else
lir = new(alloc()) LWasmCall(args, ins->numOperands(), needsBoundsCheck);
lir = lowerWasmCall<LWasmCall>(ins, needsBoundsCheck);
if (!lir)
return;
if (ins->type() == MIRType::None)
add(lir, ins);

Просмотреть файл

@ -63,6 +63,9 @@ class LIRGenerator : public LIRGeneratorSpecific
MOZ_MUST_USE bool lowerCallArguments(MCall* call);
template <typename LClass>
LInstruction* lowerWasmCall(MWasmCall* ins, bool needsBoundsCheck);
public:
MOZ_MUST_USE bool visitInstruction(MInstruction* ins);
MOZ_MUST_USE bool visitBlock(MBasicBlock* block);

Просмотреть файл

@ -548,27 +548,6 @@ MacroAssembler::branchTestProxyHandlerFamily(Condition cond, Register proxy, Reg
branchPtr(cond, familyAddr, ImmPtr(handlerp), label);
}
template <typename Value>
void
MacroAssembler::branchTestMIRType(Condition cond, const Value& val, MIRType type, Label* label)
{
switch (type) {
case MIRType::Null: return branchTestNull(cond, val, label);
case MIRType::Undefined: return branchTestUndefined(cond, val, label);
case MIRType::Boolean: return branchTestBoolean(cond, val, label);
case MIRType::Int32: return branchTestInt32(cond, val, label);
case MIRType::String: return branchTestString(cond, val, label);
case MIRType::Symbol: return branchTestSymbol(cond, val, label);
case MIRType::Object: return branchTestObject(cond, val, label);
case MIRType::Double: return branchTestDouble(cond, val, label);
case MIRType::MagicOptimizedArguments: // Fall through.
case MIRType::MagicIsConstructing:
case MIRType::MagicHole: return branchTestMagic(cond, val, label);
default:
MOZ_CRASH("Bad MIRType");
}
}
void
MacroAssembler::branchTestNeedsIncrementalBarrier(Condition cond, Label* label)
{

Просмотреть файл

@ -38,6 +38,46 @@ using JS::ToInt32;
using mozilla::CheckedUint32;
template <typename T>
static void
EmitTypeCheck(MacroAssembler& masm, Assembler::Condition cond, const T& src, TypeSet::Type type,
Label* label)
{
if (type.isAnyObject()) {
masm.branchTestObject(cond, src, label);
return;
}
switch (type.primitive()) {
case JSVAL_TYPE_DOUBLE:
// TI double type includes int32.
masm.branchTestNumber(cond, src, label);
break;
case JSVAL_TYPE_INT32:
masm.branchTestInt32(cond, src, label);
break;
case JSVAL_TYPE_BOOLEAN:
masm.branchTestBoolean(cond, src, label);
break;
case JSVAL_TYPE_STRING:
masm.branchTestString(cond, src, label);
break;
case JSVAL_TYPE_SYMBOL:
masm.branchTestSymbol(cond, src, label);
break;
case JSVAL_TYPE_NULL:
masm.branchTestNull(cond, src, label);
break;
case JSVAL_TYPE_UNDEFINED:
masm.branchTestUndefined(cond, src, label);
break;
case JSVAL_TYPE_MAGIC:
masm.branchTestMagic(cond, src, label);
break;
default:
MOZ_CRASH("Unexpected type");
}
}
template <typename Source> void
MacroAssembler::guardTypeSet(const Source& address, const TypeSet* types, BarrierKind kind,
Register scratch, Label* miss)
@ -64,40 +104,47 @@ MacroAssembler::guardTypeSet(const Source& address, const TypeSet* types, Barrie
tests[0] = TypeSet::DoubleType();
}
unsigned numBranches = 0;
for (size_t i = 0; i < mozilla::ArrayLength(tests); i++) {
if (types->hasType(tests[i]))
numBranches++;
}
if (!types->unknownObject() && types->getObjectCount() > 0)
numBranches++;
if (numBranches == 0) {
MOZ_ASSERT(types->empty());
jump(miss);
return;
}
Register tag = extractTag(address, scratch);
// Emit all typed tests.
BranchType lastBranch;
for (size_t i = 0; i < mozilla::ArrayLength(tests); i++) {
if (!types->hasType(tests[i]))
continue;
if (lastBranch.isInitialized())
lastBranch.emit(*this);
lastBranch = BranchType(Equal, tag, tests[i], &matched);
if (--numBranches > 0)
EmitTypeCheck(*this, Equal, tag, tests[i], &matched);
else
EmitTypeCheck(*this, NotEqual, tag, tests[i], miss);
}
// If this is the last check, invert the last branch.
if (types->hasType(TypeSet::AnyObjectType()) || !types->getObjectCount()) {
if (!lastBranch.isInitialized()) {
jump(miss);
return;
}
lastBranch.invertCondition();
lastBranch.relink(miss);
lastBranch.emit(*this);
// If we don't have specific objects to check for, we're done.
if (numBranches == 0) {
MOZ_ASSERT(types->unknownObject() || types->getObjectCount() == 0);
bind(&matched);
return;
}
if (lastBranch.isInitialized())
lastBranch.emit(*this);
// Test specific objects.
MOZ_ASSERT(scratch != InvalidReg);
MOZ_ASSERT(numBranches == 1);
branchTestObject(NotEqual, tag, miss);
if (kind != BarrierKind::TypeTagOnly) {
Register obj = extractObject(address, scratch);
guardObjectType(obj, types, scratch, miss);
@ -120,9 +167,12 @@ MacroAssembler::guardTypeSet(const Source& address, const TypeSet* types, Barrie
bind(&matched);
}
template <typename TypeSet>
#ifdef DEBUG
// guardTypeSetMightBeIncomplete is only used in DEBUG builds. If this ever
// changes, we need to make sure it's Spectre-safe.
void
MacroAssembler::guardTypeSetMightBeIncomplete(TypeSet* types, Register obj, Register scratch, Label* label)
MacroAssembler::guardTypeSetMightBeIncomplete(const TypeSet* types, Register obj,
Register scratch, Label* label)
{
// Type set guards might miss when an object's group changes. In this case
// either its old group's properties will become unknown, or it will change
@ -153,6 +203,7 @@ MacroAssembler::guardTypeSetMightBeIncomplete(TypeSet* types, Register obj, Regi
Imm32(OBJECT_FLAG_UNKNOWN_PROPERTIES), label);
}
}
#endif
void
MacroAssembler::guardObjectType(Register obj, const TypeSet* types,
@ -170,59 +221,59 @@ MacroAssembler::guardObjectType(Register obj, const TypeSet* types,
// to trigger the barrier on the contents of type sets passed in here.
Label matched;
BranchGCPtr lastBranch;
MOZ_ASSERT(!lastBranch.isInitialized());
bool hasSingletons = false;
bool hasObjectGroups = false;
unsigned numBranches = 0;
unsigned count = types->getObjectCount();
for (unsigned i = 0; i < count; i++) {
if (!types->getSingletonNoBarrier(i)) {
hasObjectGroups = hasObjectGroups || types->getGroupNoBarrier(i);
continue;
if (types->getGroupNoBarrier(i)) {
hasObjectGroups = true;
numBranches++;
} else if (types->getSingletonNoBarrier(i)) {
hasSingletons = true;
numBranches++;
}
}
if (lastBranch.isInitialized()) {
comment("emit GC pointer checks");
lastBranch.emit(*this);
if (numBranches == 0) {
jump(miss);
return;
}
if (hasSingletons) {
for (unsigned i = 0; i < count; i++) {
JSObject* singleton = types->getSingletonNoBarrier(i);
if (!singleton)
continue;
if (--numBranches > 0)
branchPtr(Equal, obj, ImmGCPtr(singleton), &matched);
else
branchPtr(NotEqual, obj, ImmGCPtr(singleton), miss);
}
JSObject* object = types->getSingletonNoBarrier(i);
lastBranch = BranchGCPtr(Equal, obj, ImmGCPtr(object), &matched);
}
if (hasObjectGroups) {
comment("has object groups");
// We are possibly going to overwrite the obj register. So already
// emit the branch, since branch depends on previous value of obj
// register and there is definitely a branch following. So no need
// to invert the condition.
if (lastBranch.isInitialized())
lastBranch.emit(*this);
lastBranch = BranchGCPtr();
// Note: Some platforms give the same register for obj and scratch.
// Make sure when writing to scratch, the obj register isn't used anymore!
loadPtr(Address(obj, JSObject::offsetOfGroup()), scratch);
for (unsigned i = 0; i < count; i++) {
if (!types->getGroupNoBarrier(i))
ObjectGroup* group = types->getGroupNoBarrier(i);
if (!group)
continue;
if (lastBranch.isInitialized())
lastBranch.emit(*this);
ObjectGroup* group = types->getGroupNoBarrier(i);
lastBranch = BranchGCPtr(Equal, scratch, ImmGCPtr(group), &matched);
if (--numBranches > 0)
branchPtr(Equal, scratch, ImmGCPtr(group), &matched);
else
branchPtr(NotEqual, scratch, ImmGCPtr(group), miss);
}
}
if (!lastBranch.isInitialized()) {
jump(miss);
return;
}
lastBranch.invertCondition();
lastBranch.relink(miss);
lastBranch.emit(*this);
MOZ_ASSERT(numBranches == 0);
bind(&matched);
}
@ -234,10 +285,6 @@ template void MacroAssembler::guardTypeSet(const ValueOperand& value, const Type
template void MacroAssembler::guardTypeSet(const TypedOrValueRegister& value, const TypeSet* types,
BarrierKind kind, Register scratch, Label* miss);
template void MacroAssembler::guardTypeSetMightBeIncomplete(const TemporaryTypeSet* types,
Register obj, Register scratch,
Label* label);
template<typename S, typename T>
static void
StoreToTypedFloatArray(MacroAssembler& masm, int arrayType, const S& value, const T& dest,
@ -3292,47 +3339,34 @@ MacroAssembler::wasmEmitOldTrapOutOfLineCode()
}
}
if (site.trap == wasm::Trap::IndirectCallBadSig) {
// The indirect call bad-signature trap is a special case for two
// reasons:
// - the check happens in the very first instructions of the
// prologue, before the stack frame has been set up which messes
// up everything (stack depth computations, unwinding)
// - the check happens in the callee while the trap should be
// reported at the caller's call_indirect
// To solve both problems at once, the out-of-line path (far) jumps
// directly to the trap exit stub. This takes advantage of the fact
// that there is already a CallSite for call_indirect and the
// current pre-prologue stack/register state.
append(wasm::OldTrapFarJump(site.trap, farJumpWithPatch()));
} else {
// Inherit the frame depth of the trap site. This value is captured
// by the wasm::CallSite to allow unwinding this frame.
setFramePushed(site.framePushed);
MOZ_ASSERT(site.trap != wasm::Trap::IndirectCallBadSig);
// Align the stack for a nullary call.
size_t alreadyPushed = sizeof(wasm::Frame) + framePushed();
size_t toPush = ABIArgGenerator().stackBytesConsumedSoFar();
if (size_t dec = StackDecrementForCall(ABIStackAlignment, alreadyPushed, toPush))
reserveStack(dec);
// Inherit the frame depth of the trap site. This value is captured
// by the wasm::CallSite to allow unwinding this frame.
setFramePushed(site.framePushed);
// To call the trap handler function, we must have the WasmTlsReg
// filled since this is the normal calling ABI. To avoid requiring
// every trapping operation to have the TLS register filled for the
// rare case that it takes a trap, we restore it from the frame on
// the out-of-line path. However, there are millions of out-of-line
// paths (viz. for loads/stores), so the load is factored out into
// the shared FarJumpIsland generated by patchCallSites.
// Align the stack for a nullary call.
size_t alreadyPushed = sizeof(wasm::Frame) + framePushed();
size_t toPush = ABIArgGenerator().stackBytesConsumedSoFar();
if (size_t dec = StackDecrementForCall(ABIStackAlignment, alreadyPushed, toPush))
reserveStack(dec);
// Call the trap's exit, using the bytecode offset of the trap site.
// Note that this code is inside the same CodeRange::Function as the
// trap site so it's as if the trapping instruction called the
// trap-handling function. The frame iterator knows to skip the trap
// exit's frame so that unwinding begins at the frame and offset of
// the trapping instruction.
wasm::CallSiteDesc desc(site.offset, wasm::CallSiteDesc::OldTrapExit);
call(desc, site.trap);
}
// To call the trap handler function, we must have the WasmTlsReg
// filled since this is the normal calling ABI. To avoid requiring
// every trapping operation to have the TLS register filled for the
// rare case that it takes a trap, we restore it from the frame on
// the out-of-line path. However, there are millions of out-of-line
// paths (viz. for loads/stores), so the load is factored out into
// the shared FarJumpIsland generated by patchCallSites.
// Call the trap's exit, using the bytecode offset of the trap site.
// Note that this code is inside the same CodeRange::Function as the
// trap site so it's as if the trapping instruction called the
// trap-handling function. The frame iterator knows to skip the trap
// exit's frame so that unwinding begins at the frame and offset of
// the trapping instruction.
wasm::CallSiteDesc desc(site.offset, wasm::CallSiteDesc::OldTrapExit);
call(desc, site.trap);
#ifdef DEBUG
// Traps do not return, so no need to freeStack().
@ -3482,29 +3516,6 @@ MacroAssembler::loadWasmTlsRegFromFrame(Register dest)
loadPtr(Address(getStackPointer(), framePushed() + offsetof(wasm::Frame, tls)), dest);
}
void
MacroAssembler::BranchType::emit(MacroAssembler& masm)
{
MOZ_ASSERT(isInitialized());
MIRType mirType = MIRType::None;
if (type_.isPrimitive()) {
if (type_.isMagicArguments())
mirType = MIRType::MagicOptimizedArguments;
else
mirType = MIRTypeFromValueType(type_.primitive());
} else if (type_.isAnyObject()) {
mirType = MIRType::Object;
} else {
MOZ_CRASH("Unknown conversion to mirtype");
}
if (mirType == MIRType::Double)
masm.branchTestNumber(cond(), reg(), jump());
else
masm.branchTestMIRType(cond(), reg(), mirType, jump());
}
void
MacroAssembler::BranchGCPtr::emit(MacroAssembler& masm)
{

Просмотреть файл

@ -303,30 +303,6 @@ class MacroAssembler : public MacroAssemblerSpecific
void relink(Label* jump) {
jump_ = jump;
}
virtual void emit(MacroAssembler& masm) = 0;
};
/*
* Creates a branch based on a specific TypeSet::Type.
* Note: emits number test (int/double) for TypeSet::DoubleType()
*/
class BranchType : public Branch
{
TypeSet::Type type_;
public:
BranchType()
: Branch(),
type_(TypeSet::UnknownType())
{ }
BranchType(Condition cond, Register reg, TypeSet::Type type, Label* jump)
: Branch(cond, reg, jump),
type_(type)
{ }
void emit(MacroAssembler& masm) override;
};
/*
@ -347,7 +323,7 @@ class MacroAssembler : public MacroAssemblerSpecific
ptr_(ptr)
{ }
void emit(MacroAssembler& masm) override;
void emit(MacroAssembler& masm);
};
mozilla::Maybe<AutoRooter> autoRooter_;
@ -1208,9 +1184,6 @@ class MacroAssembler : public MacroAssemblerSpecific
inline void branchTestProxyHandlerFamily(Condition cond, Register proxy, Register scratch,
const void* handlerp, Label* label);
template <typename Value>
inline void branchTestMIRType(Condition cond, const Value& val, MIRType type, Label* label);
// Emit type case branch on tag matching if the type tag in the definition
// might actually be that type.
void maybeBranchTestType(MIRType type, MDefinition* maybeDef, Register tag, Label* label);
@ -1512,50 +1485,52 @@ class MacroAssembler : public MacroAssemblerSpecific
// `ptr` will be updated if access.offset() != 0 or access.type() == Scalar::Int64.
void wasmLoad(const wasm::MemoryAccessDesc& access, Register memoryBase, Register ptr,
Register ptrScratch, AnyRegister output)
DEFINED_ON(arm);
DEFINED_ON(arm, mips_shared);
void wasmLoadI64(const wasm::MemoryAccessDesc& access, Register memoryBase, Register ptr,
Register ptrScratch, Register64 output)
DEFINED_ON(arm);
DEFINED_ON(arm, mips32, mips64);
void wasmStore(const wasm::MemoryAccessDesc& access, AnyRegister value, Register memoryBase,
Register ptr, Register ptrScratch)
DEFINED_ON(arm);
DEFINED_ON(arm, mips_shared);
void wasmStoreI64(const wasm::MemoryAccessDesc& access, Register64 value, Register memoryBase,
Register ptr, Register ptrScratch)
DEFINED_ON(arm);
DEFINED_ON(arm, mips32, mips64);
// `ptr` will always be updated.
void wasmUnalignedLoad(const wasm::MemoryAccessDesc& access, Register memoryBase, Register ptr,
Register ptrScratch, Register output, Register tmp)
DEFINED_ON(arm);
DEFINED_ON(arm, mips32, mips64);
// `ptr` will always be updated and `tmp1` is always needed. `tmp2` is
// ARM: `ptr` will always be updated and `tmp1` is always needed. `tmp2` is
// needed for Float32; `tmp2` and `tmp3` are needed for Float64. Temps must
// be Invalid when they are not needed.
// MIPS: `ptr` will always be updated.
void wasmUnalignedLoadFP(const wasm::MemoryAccessDesc& access, Register memoryBase, Register ptr,
Register ptrScratch, FloatRegister output, Register tmp1, Register tmp2,
Register tmp3)
DEFINED_ON(arm);
DEFINED_ON(arm, mips32, mips64);
// `ptr` will always be updated.
void wasmUnalignedLoadI64(const wasm::MemoryAccessDesc& access, Register memoryBase, Register ptr,
Register ptrScratch, Register64 output, Register tmp)
DEFINED_ON(arm);
DEFINED_ON(arm, mips32, mips64);
// `ptr` and `value` will always be updated.
// ARM: `ptr` and `value` will always be updated. 'tmp' must be Invalid.
// MIPS: `ptr` will always be updated.
void wasmUnalignedStore(const wasm::MemoryAccessDesc& access, Register value, Register memoryBase,
Register ptr, Register ptrScratch)
DEFINED_ON(arm);
Register ptr, Register ptrScratch, Register tmp)
DEFINED_ON(arm, mips32, mips64);
// `ptr` will always be updated.
void wasmUnalignedStoreFP(const wasm::MemoryAccessDesc& access, FloatRegister floatValue,
Register memoryBase, Register ptr, Register ptrScratch, Register tmp)
DEFINED_ON(arm);
DEFINED_ON(arm, mips32, mips64);
// `ptr` will always be updated.
void wasmUnalignedStoreI64(const wasm::MemoryAccessDesc& access, Register64 value,
Register memoryBase, Register ptr, Register ptrScratch,
Register tmp)
DEFINED_ON(arm);
DEFINED_ON(arm, mips32, mips64);
// wasm specific methods, used in both the wasm baseline compiler and ion.
@ -1567,7 +1542,7 @@ class MacroAssembler : public MacroAssemblerSpecific
Label* oolEntry) PER_SHARED_ARCH;
void oolWasmTruncateCheckF64ToI32(FloatRegister input, Register output, TruncFlags flags,
wasm::BytecodeOffset off, Label* rejoin)
DEFINED_ON(arm, arm64, x86_shared);
DEFINED_ON(arm, arm64, x86_shared, mips_shared);
void wasmTruncateFloat32ToUInt32(FloatRegister input, Register output, bool isSaturating,
Label* oolEntry) PER_ARCH;
@ -1575,29 +1550,29 @@ class MacroAssembler : public MacroAssemblerSpecific
Label* oolEntry) PER_SHARED_ARCH;
void oolWasmTruncateCheckF32ToI32(FloatRegister input, Register output, TruncFlags flags,
wasm::BytecodeOffset off, Label* rejoin)
DEFINED_ON(arm, arm64, x86_shared);
DEFINED_ON(arm, arm64, x86_shared, mips_shared);
// The truncate-to-int64 methods will always bind the `oolRejoin` label
// after the last emitted instruction.
void wasmTruncateDoubleToInt64(FloatRegister input, Register64 output, bool isSaturating,
Label* oolEntry, Label* oolRejoin, FloatRegister tempDouble)
DEFINED_ON(arm64, x86, x64);
DEFINED_ON(arm64, x86, x64, mips64);
void wasmTruncateDoubleToUInt64(FloatRegister input, Register64 output, bool isSaturating,
Label* oolEntry, Label* oolRejoin, FloatRegister tempDouble)
DEFINED_ON(arm64, x86, x64);
DEFINED_ON(arm64, x86, x64, mips64);
void oolWasmTruncateCheckF64ToI64(FloatRegister input, Register64 output, TruncFlags flags,
wasm::BytecodeOffset off, Label* rejoin)
DEFINED_ON(arm, arm64, x86_shared);
DEFINED_ON(arm, arm64, x86_shared, mips_shared);
void wasmTruncateFloat32ToInt64(FloatRegister input, Register64 output, bool isSaturating,
Label* oolEntry, Label* oolRejoin, FloatRegister tempDouble)
DEFINED_ON(arm64, x86, x64);
DEFINED_ON(arm64, x86, x64, mips64);
void wasmTruncateFloat32ToUInt64(FloatRegister input, Register64 output, bool isSaturating,
Label* oolEntry, Label* oolRejoin, FloatRegister tempDouble)
DEFINED_ON(arm64, x86, x64);
DEFINED_ON(arm64, x86, x64, mips64);
void oolWasmTruncateCheckF32ToI64(FloatRegister input, Register64 output, TruncFlags flags,
wasm::BytecodeOffset off, Label* rejoin)
DEFINED_ON(arm, arm64, x86_shared);
DEFINED_ON(arm, arm64, x86_shared, mips_shared);
// This function takes care of loading the callee's TLS and pinned regs but
// it is the caller's responsibility to save/restore TLS or pinned regs.
@ -1955,8 +1930,10 @@ class MacroAssembler : public MacroAssemblerSpecific
void guardObjectType(Register obj, const TypeSet* types, Register scratch, Label* miss);
template <typename TypeSet>
void guardTypeSetMightBeIncomplete(TypeSet* types, Register obj, Register scratch, Label* label);
#ifdef DEBUG
void guardTypeSetMightBeIncomplete(const TypeSet* types, Register obj, Register scratch,
Label* label);
#endif
void loadObjShape(Register objReg, Register dest) {
loadPtr(Address(objReg, ShapedObject::offsetOfShape()), dest);

Просмотреть файл

@ -151,9 +151,6 @@ class Registers
(1 << Registers::lr) |
(1 << Registers::pc);
// Registers that can be allocated without being saved, generally.
static const SetType TempMask = VolatileMask & ~NonAllocatableMask;
// Registers returned from a JS -> JS call.
static const SetType JSCallMask =
(1 << Registers::r2) |
@ -362,9 +359,6 @@ class FloatRegisters
(1ULL << s30) |
(1ULL << s31);
// Registers that can be allocated without being saved, generally.
static const SetType TempMask = VolatileMask & ~NonAllocatableMask;
static const SetType AllocatableMask = AllMask & ~NonAllocatableMask;
};

Просмотреть файл

@ -2185,7 +2185,7 @@ CodeGeneratorARM::emitWasmUnalignedStore(T* lir)
FloatRegister value = ToFloatRegister(lir->getOperand(LWasmUnalignedStore::ValueIndex));
masm.wasmUnalignedStoreFP(mir->access(), value, HeapReg, ptr, ptr, valOrTmp);
} else {
masm.wasmUnalignedStore(mir->access(), valOrTmp, HeapReg, ptr, ptr);
masm.wasmUnalignedStore(mir->access(), valOrTmp, HeapReg, ptr, ptr, Register::Invalid());
}
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше