diff --git a/.cron.yml b/.cron.yml index cffb8313e970..a48b3e147e6e 100644 --- a/.cron.yml +++ b/.cron.yml @@ -105,10 +105,4 @@ jobs: target-tasks-method: nightly_file_update run-on-projects: - mozilla-central - when: - by-project: - # No default branch - mozilla-central: - # Buildbot start time is 10:02am UTC, until we are able to - # disable buildbot scheduling, use +12h - - {hour: 22, minute: 0} + when: [] # don't run for now due to unforeseen issues diff --git a/browser/extensions/pdfjs/README.mozilla b/browser/extensions/pdfjs/README.mozilla index 5ea86989823d..30b3e1b46c9e 100644 --- a/browser/extensions/pdfjs/README.mozilla +++ b/browser/extensions/pdfjs/README.mozilla @@ -1,5 +1,5 @@ This is the PDF.js project output, https://github.com/mozilla/pdf.js -Current extension version is: 1.9.597 +Current extension version is: 1.9.607 -Taken from upstream commit: f3987bba +Taken from upstream commit: b3f84112 diff --git a/browser/extensions/pdfjs/content/build/pdf.js b/browser/extensions/pdfjs/content/build/pdf.js index 64fd0873005d..7b9ac79644c7 100644 --- a/browser/extensions/pdfjs/content/build/pdf.js +++ b/browser/extensions/pdfjs/content/build/pdf.js @@ -1511,6 +1511,9 @@ class DOMCMapReaderFactory { this.isCompressed = isCompressed; } fetch({ name }) { + if (!this.baseUrl) { + return Promise.reject(new Error('CMap baseUrl must be specified, ' + 'see "PDFJS.cMapUrl" (and also "PDFJS.cMapPacked").')); + } if (!name) { return Promise.reject(new Error('CMap name must be specified.')); } @@ -1990,6 +1993,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { if (worker.destroyed) { return Promise.reject(new Error('Worker was destroyed')); } + let apiVersion = '1.9.607'; source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch'); source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream'); source.chunkedViewerLoading = !!pdfDataRangeTransport; @@ -1999,6 +2003,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { } return worker.messageHandler.sendWithPromise('GetDocRequest', { docId, + apiVersion, source: { data: source.data, url: source.url, @@ -3309,8 +3314,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { }(); var version, build; { - exports.version = version = '1.9.597'; - exports.build = build = 'f3987bba'; + exports.version = version = '1.9.607'; + exports.build = build = 'b3f84112'; } exports.getDocument = getDocument; exports.LoopbackPort = LoopbackPort; @@ -5049,8 +5054,8 @@ exports.SVGGraphics = SVGGraphics; "use strict"; -var pdfjsVersion = '1.9.597'; -var pdfjsBuild = 'f3987bba'; +var pdfjsVersion = '1.9.607'; +var pdfjsBuild = 'b3f84112'; var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsDisplayGlobal = __w_pdfjs_require__(13); var pdfjsDisplayAPI = __w_pdfjs_require__(3); @@ -8176,8 +8181,8 @@ if (!_global_scope2.default.PDFJS) { } var PDFJS = _global_scope2.default.PDFJS; { - PDFJS.version = '1.9.597'; - PDFJS.build = 'f3987bba'; + PDFJS.version = '1.9.607'; + PDFJS.build = 'b3f84112'; } PDFJS.pdfBug = false; if (PDFJS.verbosity !== undefined) { diff --git a/browser/extensions/pdfjs/content/build/pdf.worker.js b/browser/extensions/pdfjs/content/build/pdf.worker.js index e1310a2e5613..5f54f3dfa375 100644 --- a/browser/extensions/pdfjs/content/build/pdf.worker.js +++ b/browser/extensions/pdfjs/content/build/pdf.worker.js @@ -1704,7 +1704,7 @@ var _jbig = __w_pdfjs_require__(24); var _jpg = __w_pdfjs_require__(25); -var _jpx = __w_pdfjs_require__(11); +var _jpx = __w_pdfjs_require__(10); var Stream = function StreamClosure() { function Stream(arrayBuffer, start, length, dict) { @@ -3408,8 +3408,6 @@ var _util = __w_pdfjs_require__(0); var _primitives = __w_pdfjs_require__(1); -var _function = __w_pdfjs_require__(6); - var ColorSpace = function ColorSpaceClosure() { function resizeRgbImage(src, bpc, w1, h1, w2, h2, alpha01, dest) { var COMPONENTS = 3; @@ -3519,11 +3517,11 @@ var ColorSpace = function ColorSpaceClosure() { }, usesZeroToOneRange: true }; - ColorSpace.parse = function ColorSpace_parse(cs, xref, res) { - let IR = ColorSpace.parseToIR(cs, xref, res); - return ColorSpace.fromIR(IR); + ColorSpace.parse = function (cs, xref, res, pdfFunctionFactory) { + let IR = ColorSpace.parseToIR(cs, xref, res, pdfFunctionFactory); + return ColorSpace.fromIR(IR, pdfFunctionFactory); }; - ColorSpace.fromIR = function ColorSpace_fromIR(IR) { + ColorSpace.fromIR = function (IR, pdfFunctionFactory) { var name = Array.isArray(IR) ? IR[0] : IR; var whitePoint, blackPoint, gamma; switch (name) { @@ -3547,19 +3545,19 @@ var ColorSpace = function ColorSpaceClosure() { case 'PatternCS': var basePatternCS = IR[1]; if (basePatternCS) { - basePatternCS = ColorSpace.fromIR(basePatternCS); + basePatternCS = ColorSpace.fromIR(basePatternCS, pdfFunctionFactory); } return new PatternCS(basePatternCS); case 'IndexedCS': var baseIndexedCS = IR[1]; var hiVal = IR[2]; var lookup = IR[3]; - return new IndexedCS(ColorSpace.fromIR(baseIndexedCS), hiVal, lookup); + return new IndexedCS(ColorSpace.fromIR(baseIndexedCS, pdfFunctionFactory), hiVal, lookup); case 'AlternateCS': var numComps = IR[1]; var alt = IR[2]; var tintFnIR = IR[3]; - return new AlternateCS(numComps, ColorSpace.fromIR(alt), _function.PDFFunction.fromIR(tintFnIR)); + return new AlternateCS(numComps, ColorSpace.fromIR(alt, pdfFunctionFactory), pdfFunctionFactory.createFromIR(tintFnIR)); case 'LabCS': whitePoint = IR[1]; blackPoint = IR[2]; @@ -3569,7 +3567,7 @@ var ColorSpace = function ColorSpaceClosure() { throw new _util.FormatError(`Unknown colorspace name: ${name}`); } }; - ColorSpace.parseToIR = function ColorSpace_parseToIR(cs, xref, res) { + ColorSpace.parseToIR = function (cs, xref, res, pdfFunctionFactory) { if ((0, _primitives.isName)(cs)) { var colorSpaces = res.get('ColorSpace'); if ((0, _primitives.isDict)(colorSpaces)) { @@ -3629,8 +3627,8 @@ var ColorSpace = function ColorSpaceClosure() { numComps = dict.get('N'); alt = dict.get('Alternate'); if (alt) { - var altIR = ColorSpace.parseToIR(alt, xref, res); - var altCS = ColorSpace.fromIR(altIR); + var altIR = ColorSpace.parseToIR(alt, xref, res, pdfFunctionFactory); + var altCS = ColorSpace.fromIR(altIR, pdfFunctionFactory); if (altCS.numComps === numComps) { return altIR; } @@ -3647,12 +3645,12 @@ var ColorSpace = function ColorSpaceClosure() { case 'Pattern': var basePatternCS = cs[1] || null; if (basePatternCS) { - basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res); + basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res, pdfFunctionFactory); } return ['PatternCS', basePatternCS]; case 'Indexed': case 'I': - var baseIndexedCS = ColorSpace.parseToIR(cs[1], xref, res); + var baseIndexedCS = ColorSpace.parseToIR(cs[1], xref, res, pdfFunctionFactory); var hiVal = xref.fetchIfRef(cs[2]) + 1; var lookup = xref.fetchIfRef(cs[3]); if ((0, _primitives.isStream)(lookup)) { @@ -3663,8 +3661,8 @@ var ColorSpace = function ColorSpaceClosure() { case 'DeviceN': var name = xref.fetchIfRef(cs[1]); numComps = Array.isArray(name) ? name.length : 1; - alt = ColorSpace.parseToIR(cs[2], xref, res); - var tintFnIR = _function.PDFFunction.getIR(xref, xref.fetchIfRef(cs[3])); + alt = ColorSpace.parseToIR(cs[2], xref, res, pdfFunctionFactory); + let tintFnIR = pdfFunctionFactory.createIR(xref.fetchIfRef(cs[3])); return ['AlternateCS', numComps, alt, tintFnIR]; case 'Lab': params = xref.fetchIfRef(cs[1]); @@ -5332,988 +5330,6 @@ exports.Parser = Parser; /* 6 */ /***/ (function(module, exports, __w_pdfjs_require__) { -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PostScriptCompiler = exports.PostScriptEvaluator = exports.PDFFunction = exports.isPDFFunction = undefined; - -var _util = __w_pdfjs_require__(0); - -var _primitives = __w_pdfjs_require__(1); - -var _ps_parser = __w_pdfjs_require__(26); - -let IsEvalSupportedCached = { - get value() { - return (0, _util.shadow)(this, 'value', (0, _util.isEvalSupported)()); - } -}; -var PDFFunction = function PDFFunctionClosure() { - var CONSTRUCT_SAMPLED = 0; - var CONSTRUCT_INTERPOLATED = 2; - var CONSTRUCT_STICHED = 3; - var CONSTRUCT_POSTSCRIPT = 4; - let isEvalSupported = true; - return { - setIsEvalSupported(support = true) { - isEvalSupported = support !== false; - }, - getSampleArray: function PDFFunction_getSampleArray(size, outputSize, bps, str) { - var i, ii; - var length = 1; - for (i = 0, ii = size.length; i < ii; i++) { - length *= size[i]; - } - length *= outputSize; - var array = new Array(length); - var codeSize = 0; - var codeBuf = 0; - var sampleMul = 1.0 / (Math.pow(2.0, bps) - 1); - var strBytes = str.getBytes((length * bps + 7) / 8); - var strIdx = 0; - for (i = 0; i < length; i++) { - while (codeSize < bps) { - codeBuf <<= 8; - codeBuf |= strBytes[strIdx++]; - codeSize += 8; - } - codeSize -= bps; - array[i] = (codeBuf >> codeSize) * sampleMul; - codeBuf &= (1 << codeSize) - 1; - } - return array; - }, - getIR: function PDFFunction_getIR(xref, fn) { - var dict = fn.dict; - if (!dict) { - dict = fn; - } - var types = [this.constructSampled, null, this.constructInterpolated, this.constructStiched, this.constructPostScript]; - var typeNum = dict.get('FunctionType'); - var typeFn = types[typeNum]; - if (!typeFn) { - throw new _util.FormatError('Unknown type of function'); - } - return typeFn.call(this, fn, dict, xref); - }, - fromIR: function PDFFunction_fromIR(IR) { - var type = IR[0]; - switch (type) { - case CONSTRUCT_SAMPLED: - return this.constructSampledFromIR(IR); - case CONSTRUCT_INTERPOLATED: - return this.constructInterpolatedFromIR(IR); - case CONSTRUCT_STICHED: - return this.constructStichedFromIR(IR); - default: - return this.constructPostScriptFromIR(IR); - } - }, - parse: function PDFFunction_parse(xref, fn) { - var IR = this.getIR(xref, fn); - return this.fromIR(IR); - }, - parseArray: function PDFFunction_parseArray(xref, fnObj) { - if (!Array.isArray(fnObj)) { - return this.parse(xref, fnObj); - } - var fnArray = []; - for (var j = 0, jj = fnObj.length; j < jj; j++) { - var obj = xref.fetchIfRef(fnObj[j]); - fnArray.push(PDFFunction.parse(xref, obj)); - } - return function (src, srcOffset, dest, destOffset) { - for (var i = 0, ii = fnArray.length; i < ii; i++) { - fnArray[i](src, srcOffset, dest, destOffset + i); - } - }; - }, - constructSampled: function PDFFunction_constructSampled(str, dict) { - function toMultiArray(arr) { - var inputLength = arr.length; - var out = []; - var index = 0; - for (var i = 0; i < inputLength; i += 2) { - out[index] = [arr[i], arr[i + 1]]; - ++index; - } - return out; - } - var domain = dict.getArray('Domain'); - var range = dict.getArray('Range'); - if (!domain || !range) { - throw new _util.FormatError('No domain or range'); - } - var inputSize = domain.length / 2; - var outputSize = range.length / 2; - domain = toMultiArray(domain); - range = toMultiArray(range); - var size = dict.get('Size'); - var bps = dict.get('BitsPerSample'); - var order = dict.get('Order') || 1; - if (order !== 1) { - (0, _util.info)('No support for cubic spline interpolation: ' + order); - } - var encode = dict.getArray('Encode'); - if (!encode) { - encode = []; - for (var i = 0; i < inputSize; ++i) { - encode.push(0); - encode.push(size[i] - 1); - } - } - encode = toMultiArray(encode); - var decode = dict.getArray('Decode'); - if (!decode) { - decode = range; - } else { - decode = toMultiArray(decode); - } - var samples = this.getSampleArray(size, outputSize, bps, str); - return [CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, outputSize, Math.pow(2, bps) - 1, range]; - }, - constructSampledFromIR: function PDFFunction_constructSampledFromIR(IR) { - function interpolate(x, xmin, xmax, ymin, ymax) { - return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); - } - return function constructSampledFromIRResult(src, srcOffset, dest, destOffset) { - var m = IR[1]; - var domain = IR[2]; - var encode = IR[3]; - var decode = IR[4]; - var samples = IR[5]; - var size = IR[6]; - var n = IR[7]; - var range = IR[9]; - var cubeVertices = 1 << m; - var cubeN = new Float64Array(cubeVertices); - var cubeVertex = new Uint32Array(cubeVertices); - var i, j; - for (j = 0; j < cubeVertices; j++) { - cubeN[j] = 1; - } - var k = n, - pos = 1; - for (i = 0; i < m; ++i) { - var domain_2i = domain[i][0]; - var domain_2i_1 = domain[i][1]; - var xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); - var e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); - var size_i = size[i]; - e = Math.min(Math.max(e, 0), size_i - 1); - var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; - var n0 = e0 + 1 - e; - var n1 = e - e0; - var offset0 = e0 * k; - var offset1 = offset0 + k; - for (j = 0; j < cubeVertices; j++) { - if (j & pos) { - cubeN[j] *= n1; - cubeVertex[j] += offset1; - } else { - cubeN[j] *= n0; - cubeVertex[j] += offset0; - } - } - k *= size_i; - pos <<= 1; - } - for (j = 0; j < n; ++j) { - var rj = 0; - for (i = 0; i < cubeVertices; i++) { - rj += samples[cubeVertex[i] + j] * cubeN[i]; - } - rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); - dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); - } - }; - }, - constructInterpolated: function PDFFunction_constructInterpolated(str, dict) { - var c0 = dict.getArray('C0') || [0]; - var c1 = dict.getArray('C1') || [1]; - var n = dict.get('N'); - if (!Array.isArray(c0) || !Array.isArray(c1)) { - throw new _util.FormatError('Illegal dictionary for interpolated function'); - } - var length = c0.length; - var diff = []; - for (var i = 0; i < length; ++i) { - diff.push(c1[i] - c0[i]); - } - return [CONSTRUCT_INTERPOLATED, c0, diff, n]; - }, - constructInterpolatedFromIR: function PDFFunction_constructInterpolatedFromIR(IR) { - var c0 = IR[1]; - var diff = IR[2]; - var n = IR[3]; - var length = diff.length; - return function constructInterpolatedFromIRResult(src, srcOffset, dest, destOffset) { - var x = n === 1 ? src[srcOffset] : Math.pow(src[srcOffset], n); - for (var j = 0; j < length; ++j) { - dest[destOffset + j] = c0[j] + x * diff[j]; - } - }; - }, - constructStiched: function PDFFunction_constructStiched(fn, dict, xref) { - var domain = dict.getArray('Domain'); - if (!domain) { - throw new _util.FormatError('No domain'); - } - var inputSize = domain.length / 2; - if (inputSize !== 1) { - throw new _util.FormatError('Bad domain for stiched function'); - } - var fnRefs = dict.get('Functions'); - var fns = []; - for (var i = 0, ii = fnRefs.length; i < ii; ++i) { - fns.push(PDFFunction.getIR(xref, xref.fetchIfRef(fnRefs[i]))); - } - var bounds = dict.getArray('Bounds'); - var encode = dict.getArray('Encode'); - return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; - }, - constructStichedFromIR: function PDFFunction_constructStichedFromIR(IR) { - var domain = IR[1]; - var bounds = IR[2]; - var encode = IR[3]; - var fnsIR = IR[4]; - var fns = []; - var tmpBuf = new Float32Array(1); - for (var i = 0, ii = fnsIR.length; i < ii; i++) { - fns.push(PDFFunction.fromIR(fnsIR[i])); - } - return function constructStichedFromIRResult(src, srcOffset, dest, destOffset) { - var clip = function constructStichedFromIRClip(v, min, max) { - if (v > max) { - v = max; - } else if (v < min) { - v = min; - } - return v; - }; - var v = clip(src[srcOffset], domain[0], domain[1]); - for (var i = 0, ii = bounds.length; i < ii; ++i) { - if (v < bounds[i]) { - break; - } - } - var dmin = domain[0]; - if (i > 0) { - dmin = bounds[i - 1]; - } - var dmax = domain[1]; - if (i < bounds.length) { - dmax = bounds[i]; - } - var rmin = encode[2 * i]; - var rmax = encode[2 * i + 1]; - tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); - fns[i](tmpBuf, 0, dest, destOffset); - }; - }, - constructPostScript: function PDFFunction_constructPostScript(fn, dict, xref) { - var domain = dict.getArray('Domain'); - var range = dict.getArray('Range'); - if (!domain) { - throw new _util.FormatError('No domain.'); - } - if (!range) { - throw new _util.FormatError('No range.'); - } - var lexer = new _ps_parser.PostScriptLexer(fn); - var parser = new _ps_parser.PostScriptParser(lexer); - var code = parser.parse(); - return [CONSTRUCT_POSTSCRIPT, domain, range, code]; - }, - constructPostScriptFromIR: function PDFFunction_constructPostScriptFromIR(IR) { - var domain = IR[1]; - var range = IR[2]; - var code = IR[3]; - if (isEvalSupported && IsEvalSupportedCached.value) { - let compiled = new PostScriptCompiler().compile(code, domain, range); - if (compiled) { - return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled); - } - } - (0, _util.info)('Unable to compile PS function'); - var numOutputs = range.length >> 1; - var numInputs = domain.length >> 1; - var evaluator = new PostScriptEvaluator(code); - var cache = Object.create(null); - var MAX_CACHE_SIZE = 2048 * 4; - var cache_available = MAX_CACHE_SIZE; - var tmpBuf = new Float32Array(numInputs); - return function constructPostScriptFromIRResult(src, srcOffset, dest, destOffset) { - var i, value; - var key = ''; - var input = tmpBuf; - for (i = 0; i < numInputs; i++) { - value = src[srcOffset + i]; - input[i] = value; - key += value + '_'; - } - var cachedValue = cache[key]; - if (cachedValue !== undefined) { - dest.set(cachedValue, destOffset); - return; - } - var output = new Float32Array(numOutputs); - var stack = evaluator.execute(input); - var stackIndex = stack.length - numOutputs; - for (i = 0; i < numOutputs; i++) { - value = stack[stackIndex + i]; - var bound = range[i * 2]; - if (value < bound) { - value = bound; - } else { - bound = range[i * 2 + 1]; - if (value > bound) { - value = bound; - } - } - output[i] = value; - } - if (cache_available > 0) { - cache_available--; - cache[key] = output; - } - dest.set(output, destOffset); - }; - } - }; -}(); -function isPDFFunction(v) { - var fnDict; - if (typeof v !== 'object') { - return false; - } else if ((0, _primitives.isDict)(v)) { - fnDict = v; - } else if ((0, _primitives.isStream)(v)) { - fnDict = v.dict; - } else { - return false; - } - return fnDict.has('FunctionType'); -} -var PostScriptStack = function PostScriptStackClosure() { - var MAX_STACK_SIZE = 100; - function PostScriptStack(initialStack) { - this.stack = !initialStack ? [] : Array.prototype.slice.call(initialStack, 0); - } - PostScriptStack.prototype = { - push: function PostScriptStack_push(value) { - if (this.stack.length >= MAX_STACK_SIZE) { - throw new Error('PostScript function stack overflow.'); - } - this.stack.push(value); - }, - pop: function PostScriptStack_pop() { - if (this.stack.length <= 0) { - throw new Error('PostScript function stack underflow.'); - } - return this.stack.pop(); - }, - copy: function PostScriptStack_copy(n) { - if (this.stack.length + n >= MAX_STACK_SIZE) { - throw new Error('PostScript function stack overflow.'); - } - var stack = this.stack; - for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { - stack.push(stack[i]); - } - }, - index: function PostScriptStack_index(n) { - this.push(this.stack[this.stack.length - n - 1]); - }, - roll: function PostScriptStack_roll(n, p) { - var stack = this.stack; - var l = stack.length - n; - var r = stack.length - 1, - c = l + (p - Math.floor(p / n) * n), - i, - j, - t; - for (i = l, j = r; i < j; i++, j--) { - t = stack[i]; - stack[i] = stack[j]; - stack[j] = t; - } - for (i = l, j = c - 1; i < j; i++, j--) { - t = stack[i]; - stack[i] = stack[j]; - stack[j] = t; - } - for (i = c, j = r; i < j; i++, j--) { - t = stack[i]; - stack[i] = stack[j]; - stack[j] = t; - } - } - }; - return PostScriptStack; -}(); -var PostScriptEvaluator = function PostScriptEvaluatorClosure() { - function PostScriptEvaluator(operators) { - this.operators = operators; - } - PostScriptEvaluator.prototype = { - execute: function PostScriptEvaluator_execute(initialStack) { - var stack = new PostScriptStack(initialStack); - var counter = 0; - var operators = this.operators; - var length = operators.length; - var operator, a, b; - while (counter < length) { - operator = operators[counter++]; - if (typeof operator === 'number') { - stack.push(operator); - continue; - } - switch (operator) { - case 'jz': - b = stack.pop(); - a = stack.pop(); - if (!a) { - counter = b; - } - break; - case 'j': - a = stack.pop(); - counter = a; - break; - case 'abs': - a = stack.pop(); - stack.push(Math.abs(a)); - break; - case 'add': - b = stack.pop(); - a = stack.pop(); - stack.push(a + b); - break; - case 'and': - b = stack.pop(); - a = stack.pop(); - if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { - stack.push(a && b); - } else { - stack.push(a & b); - } - break; - case 'atan': - a = stack.pop(); - stack.push(Math.atan(a)); - break; - case 'bitshift': - b = stack.pop(); - a = stack.pop(); - if (a > 0) { - stack.push(a << b); - } else { - stack.push(a >> b); - } - break; - case 'ceiling': - a = stack.pop(); - stack.push(Math.ceil(a)); - break; - case 'copy': - a = stack.pop(); - stack.copy(a); - break; - case 'cos': - a = stack.pop(); - stack.push(Math.cos(a)); - break; - case 'cvi': - a = stack.pop() | 0; - stack.push(a); - break; - case 'cvr': - break; - case 'div': - b = stack.pop(); - a = stack.pop(); - stack.push(a / b); - break; - case 'dup': - stack.copy(1); - break; - case 'eq': - b = stack.pop(); - a = stack.pop(); - stack.push(a === b); - break; - case 'exch': - stack.roll(2, 1); - break; - case 'exp': - b = stack.pop(); - a = stack.pop(); - stack.push(Math.pow(a, b)); - break; - case 'false': - stack.push(false); - break; - case 'floor': - a = stack.pop(); - stack.push(Math.floor(a)); - break; - case 'ge': - b = stack.pop(); - a = stack.pop(); - stack.push(a >= b); - break; - case 'gt': - b = stack.pop(); - a = stack.pop(); - stack.push(a > b); - break; - case 'idiv': - b = stack.pop(); - a = stack.pop(); - stack.push(a / b | 0); - break; - case 'index': - a = stack.pop(); - stack.index(a); - break; - case 'le': - b = stack.pop(); - a = stack.pop(); - stack.push(a <= b); - break; - case 'ln': - a = stack.pop(); - stack.push(Math.log(a)); - break; - case 'log': - a = stack.pop(); - stack.push(Math.log(a) / Math.LN10); - break; - case 'lt': - b = stack.pop(); - a = stack.pop(); - stack.push(a < b); - break; - case 'mod': - b = stack.pop(); - a = stack.pop(); - stack.push(a % b); - break; - case 'mul': - b = stack.pop(); - a = stack.pop(); - stack.push(a * b); - break; - case 'ne': - b = stack.pop(); - a = stack.pop(); - stack.push(a !== b); - break; - case 'neg': - a = stack.pop(); - stack.push(-a); - break; - case 'not': - a = stack.pop(); - if ((0, _util.isBool)(a)) { - stack.push(!a); - } else { - stack.push(~a); - } - break; - case 'or': - b = stack.pop(); - a = stack.pop(); - if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { - stack.push(a || b); - } else { - stack.push(a | b); - } - break; - case 'pop': - stack.pop(); - break; - case 'roll': - b = stack.pop(); - a = stack.pop(); - stack.roll(a, b); - break; - case 'round': - a = stack.pop(); - stack.push(Math.round(a)); - break; - case 'sin': - a = stack.pop(); - stack.push(Math.sin(a)); - break; - case 'sqrt': - a = stack.pop(); - stack.push(Math.sqrt(a)); - break; - case 'sub': - b = stack.pop(); - a = stack.pop(); - stack.push(a - b); - break; - case 'true': - stack.push(true); - break; - case 'truncate': - a = stack.pop(); - a = a < 0 ? Math.ceil(a) : Math.floor(a); - stack.push(a); - break; - case 'xor': - b = stack.pop(); - a = stack.pop(); - if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { - stack.push(a !== b); - } else { - stack.push(a ^ b); - } - break; - default: - throw new _util.FormatError(`Unknown operator ${operator}`); - } - } - return stack.stack; - } - }; - return PostScriptEvaluator; -}(); -var PostScriptCompiler = function PostScriptCompilerClosure() { - function AstNode(type) { - this.type = type; - } - AstNode.prototype.visit = function (visitor) { - throw new Error('abstract method'); - }; - function AstArgument(index, min, max) { - AstNode.call(this, 'args'); - this.index = index; - this.min = min; - this.max = max; - } - AstArgument.prototype = Object.create(AstNode.prototype); - AstArgument.prototype.visit = function (visitor) { - visitor.visitArgument(this); - }; - function AstLiteral(number) { - AstNode.call(this, 'literal'); - this.number = number; - this.min = number; - this.max = number; - } - AstLiteral.prototype = Object.create(AstNode.prototype); - AstLiteral.prototype.visit = function (visitor) { - visitor.visitLiteral(this); - }; - function AstBinaryOperation(op, arg1, arg2, min, max) { - AstNode.call(this, 'binary'); - this.op = op; - this.arg1 = arg1; - this.arg2 = arg2; - this.min = min; - this.max = max; - } - AstBinaryOperation.prototype = Object.create(AstNode.prototype); - AstBinaryOperation.prototype.visit = function (visitor) { - visitor.visitBinaryOperation(this); - }; - function AstMin(arg, max) { - AstNode.call(this, 'max'); - this.arg = arg; - this.min = arg.min; - this.max = max; - } - AstMin.prototype = Object.create(AstNode.prototype); - AstMin.prototype.visit = function (visitor) { - visitor.visitMin(this); - }; - function AstVariable(index, min, max) { - AstNode.call(this, 'var'); - this.index = index; - this.min = min; - this.max = max; - } - AstVariable.prototype = Object.create(AstNode.prototype); - AstVariable.prototype.visit = function (visitor) { - visitor.visitVariable(this); - }; - function AstVariableDefinition(variable, arg) { - AstNode.call(this, 'definition'); - this.variable = variable; - this.arg = arg; - } - AstVariableDefinition.prototype = Object.create(AstNode.prototype); - AstVariableDefinition.prototype.visit = function (visitor) { - visitor.visitVariableDefinition(this); - }; - function ExpressionBuilderVisitor() { - this.parts = []; - } - ExpressionBuilderVisitor.prototype = { - visitArgument(arg) { - this.parts.push('Math.max(', arg.min, ', Math.min(', arg.max, ', src[srcOffset + ', arg.index, ']))'); - }, - visitVariable(variable) { - this.parts.push('v', variable.index); - }, - visitLiteral(literal) { - this.parts.push(literal.number); - }, - visitBinaryOperation(operation) { - this.parts.push('('); - operation.arg1.visit(this); - this.parts.push(' ', operation.op, ' '); - operation.arg2.visit(this); - this.parts.push(')'); - }, - visitVariableDefinition(definition) { - this.parts.push('var '); - definition.variable.visit(this); - this.parts.push(' = '); - definition.arg.visit(this); - this.parts.push(';'); - }, - visitMin(max) { - this.parts.push('Math.min('); - max.arg.visit(this); - this.parts.push(', ', max.max, ')'); - }, - toString() { - return this.parts.join(''); - } - }; - function buildAddOperation(num1, num2) { - if (num2.type === 'literal' && num2.number === 0) { - return num1; - } - if (num1.type === 'literal' && num1.number === 0) { - return num2; - } - if (num2.type === 'literal' && num1.type === 'literal') { - return new AstLiteral(num1.number + num2.number); - } - return new AstBinaryOperation('+', num1, num2, num1.min + num2.min, num1.max + num2.max); - } - function buildMulOperation(num1, num2) { - if (num2.type === 'literal') { - if (num2.number === 0) { - return new AstLiteral(0); - } else if (num2.number === 1) { - return num1; - } else if (num1.type === 'literal') { - return new AstLiteral(num1.number * num2.number); - } - } - if (num1.type === 'literal') { - if (num1.number === 0) { - return new AstLiteral(0); - } else if (num1.number === 1) { - return num2; - } - } - var min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); - var max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); - return new AstBinaryOperation('*', num1, num2, min, max); - } - function buildSubOperation(num1, num2) { - if (num2.type === 'literal') { - if (num2.number === 0) { - return num1; - } else if (num1.type === 'literal') { - return new AstLiteral(num1.number - num2.number); - } - } - if (num2.type === 'binary' && num2.op === '-' && num1.type === 'literal' && num1.number === 1 && num2.arg1.type === 'literal' && num2.arg1.number === 1) { - return num2.arg2; - } - return new AstBinaryOperation('-', num1, num2, num1.min - num2.max, num1.max - num2.min); - } - function buildMinOperation(num1, max) { - if (num1.min >= max) { - return new AstLiteral(max); - } else if (num1.max <= max) { - return num1; - } - return new AstMin(num1, max); - } - function PostScriptCompiler() {} - PostScriptCompiler.prototype = { - compile: function PostScriptCompiler_compile(code, domain, range) { - var stack = []; - var i, ii; - var instructions = []; - var inputSize = domain.length >> 1, - outputSize = range.length >> 1; - var lastRegister = 0; - var n, j; - var num1, num2, ast1, ast2, tmpVar, item; - for (i = 0; i < inputSize; i++) { - stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); - } - for (i = 0, ii = code.length; i < ii; i++) { - item = code[i]; - if (typeof item === 'number') { - stack.push(new AstLiteral(item)); - continue; - } - switch (item) { - case 'add': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildAddOperation(num1, num2)); - break; - case 'cvr': - if (stack.length < 1) { - return null; - } - break; - case 'mul': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildMulOperation(num1, num2)); - break; - case 'sub': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - stack.push(buildSubOperation(num1, num2)); - break; - case 'exch': - if (stack.length < 2) { - return null; - } - ast1 = stack.pop(); - ast2 = stack.pop(); - stack.push(ast1, ast2); - break; - case 'pop': - if (stack.length < 1) { - return null; - } - stack.pop(); - break; - case 'index': - if (stack.length < 1) { - return null; - } - num1 = stack.pop(); - if (num1.type !== 'literal') { - return null; - } - n = num1.number; - if (n < 0 || !Number.isInteger(n) || stack.length < n) { - return null; - } - ast1 = stack[stack.length - n - 1]; - if (ast1.type === 'literal' || ast1.type === 'var') { - stack.push(ast1); - break; - } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - n - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - case 'dup': - if (stack.length < 1) { - return null; - } - if (typeof code[i + 1] === 'number' && code[i + 2] === 'gt' && code[i + 3] === i + 7 && code[i + 4] === 'jz' && code[i + 5] === 'pop' && code[i + 6] === code[i + 1]) { - num1 = stack.pop(); - stack.push(buildMinOperation(num1, code[i + 1])); - i += 6; - break; - } - ast1 = stack[stack.length - 1]; - if (ast1.type === 'literal' || ast1.type === 'var') { - stack.push(ast1); - break; - } - tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); - stack[stack.length - 1] = tmpVar; - stack.push(tmpVar); - instructions.push(new AstVariableDefinition(tmpVar, ast1)); - break; - case 'roll': - if (stack.length < 2) { - return null; - } - num2 = stack.pop(); - num1 = stack.pop(); - if (num2.type !== 'literal' || num1.type !== 'literal') { - return null; - } - j = num2.number; - n = num1.number; - if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { - return null; - } - j = (j % n + n) % n; - if (j === 0) { - break; - } - Array.prototype.push.apply(stack, stack.splice(stack.length - n, n - j)); - break; - default: - return null; - } - } - if (stack.length !== outputSize) { - return null; - } - var result = []; - instructions.forEach(function (instruction) { - var statementBuilder = new ExpressionBuilderVisitor(); - instruction.visit(statementBuilder); - result.push(statementBuilder.toString()); - }); - stack.forEach(function (expr, i) { - var statementBuilder = new ExpressionBuilderVisitor(); - expr.visit(statementBuilder); - var min = range[i * 2], - max = range[i * 2 + 1]; - var out = [statementBuilder.toString()]; - if (min > expr.min) { - out.unshift('Math.max(', min, ', '); - out.push(')'); - } - if (max < expr.max) { - out.unshift('Math.min(', max, ', '); - out.push(')'); - } - out.unshift('dest[destOffset + ', i, '] = '); - out.push(';'); - result.push(out.join('')); - }); - return result.join('\n'); - } - }; - return PostScriptCompiler; -}(); -exports.isPDFFunction = isPDFFunction; -exports.PDFFunction = PDFFunction; -exports.PostScriptEvaluator = PostScriptEvaluator; -exports.PostScriptCompiler = PostScriptCompiler; - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __w_pdfjs_require__) { - var getLookupTableFactory = __w_pdfjs_require__(0).getLookupTableFactory; var getGlyphsUnicode = getLookupTableFactory(function (t) { t['A'] = 0x0041; @@ -10847,7 +9863,7 @@ exports.getGlyphsUnicode = getGlyphsUnicode; exports.getDingbatsGlyphsUnicode = getDingbatsGlyphsUnicode; /***/ }), -/* 8 */ +/* 7 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -11315,7 +10331,7 @@ exports.ChunkedStream = ChunkedStream; exports.ChunkedStreamManager = ChunkedStreamManager; /***/ }), -/* 9 */ +/* 8 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -11332,9 +10348,9 @@ var _primitives = __w_pdfjs_require__(1); var _parser = __w_pdfjs_require__(5); -var _chunked_stream = __w_pdfjs_require__(8); +var _chunked_stream = __w_pdfjs_require__(7); -var _crypto = __w_pdfjs_require__(12); +var _crypto = __w_pdfjs_require__(11); var _colorspace = __w_pdfjs_require__(3); @@ -12818,7 +11834,7 @@ exports.XRef = XRef; exports.FileSpec = FileSpec; /***/ }), -/* 10 */ +/* 9 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -13158,7 +12174,7 @@ var ArithmeticDecoder = function ArithmeticDecoderClosure() { exports.ArithmeticDecoder = ArithmeticDecoder; /***/ }), -/* 11 */ +/* 10 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -13171,7 +12187,7 @@ exports.JpxImage = undefined; var _util = __w_pdfjs_require__(0); -var _arithmetic_decoder = __w_pdfjs_require__(10); +var _arithmetic_decoder = __w_pdfjs_require__(9); let JpxError = function JpxErrorClosure() { function JpxError(msg) { @@ -15085,7 +14101,7 @@ var JpxImage = function JpxImageClosure() { exports.JpxImage = JpxImage; /***/ }), -/* 12 */ +/* 11 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -16678,7 +15694,7 @@ exports.calculateSHA384 = calculateSHA384; exports.calculateSHA512 = calculateSHA512; /***/ }), -/* 13 */ +/* 12 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -16691,33 +15707,33 @@ exports.PartialEvaluator = exports.OperatorList = undefined; var _util = __w_pdfjs_require__(0); -var _cmap = __w_pdfjs_require__(27); +var _cmap = __w_pdfjs_require__(26); var _stream = __w_pdfjs_require__(2); var _primitives = __w_pdfjs_require__(1); -var _fonts = __w_pdfjs_require__(28); +var _fonts = __w_pdfjs_require__(27); var _encodings = __w_pdfjs_require__(4); -var _unicode = __w_pdfjs_require__(16); +var _unicode = __w_pdfjs_require__(15); -var _standard_fonts = __w_pdfjs_require__(15); +var _standard_fonts = __w_pdfjs_require__(14); -var _pattern = __w_pdfjs_require__(32); - -var _function = __w_pdfjs_require__(6); +var _pattern = __w_pdfjs_require__(31); var _parser = __w_pdfjs_require__(5); -var _bidi = __w_pdfjs_require__(33); +var _bidi = __w_pdfjs_require__(32); var _colorspace = __w_pdfjs_require__(3); -var _glyphlist = __w_pdfjs_require__(7); +var _glyphlist = __w_pdfjs_require__(6); -var _metrics = __w_pdfjs_require__(34); +var _metrics = __w_pdfjs_require__(33); + +var _function = __w_pdfjs_require__(16); var _murmurhash = __w_pdfjs_require__(35); @@ -16732,20 +15748,21 @@ var PartialEvaluator = function PartialEvaluatorClosure() { ignoreErrors: false, isEvalSupported: true }; - function NativeImageDecoder(xref, resources, handler, forceDataSchema) { + function NativeImageDecoder({ xref, resources, handler, forceDataSchema = false, pdfFunctionFactory }) { this.xref = xref; this.resources = resources; this.handler = handler; this.forceDataSchema = forceDataSchema; + this.pdfFunctionFactory = pdfFunctionFactory; } NativeImageDecoder.prototype = { canDecode(image) { - return image instanceof _stream.JpegStream && NativeImageDecoder.isDecodable(image, this.xref, this.resources); + return image instanceof _stream.JpegStream && NativeImageDecoder.isDecodable(image, this.xref, this.resources, this.pdfFunctionFactory); }, decode(image) { var dict = image.dict; var colorSpace = dict.get('ColorSpace', 'CS'); - colorSpace = _colorspace.ColorSpace.parse(colorSpace, this.xref, this.resources); + 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) { @@ -16754,23 +15771,23 @@ var PartialEvaluator = function PartialEvaluatorClosure() { }); } }; - NativeImageDecoder.isSupported = function NativeImageDecoder_isSupported(image, xref, res) { + NativeImageDecoder.isSupported = function (image, xref, res, pdfFunctionFactory) { var dict = image.dict; if (dict.has('DecodeParms') || dict.has('DP')) { return false; } - var cs = _colorspace.ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res); + var cs = _colorspace.ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res, pdfFunctionFactory); return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') && cs.isDefaultDecode(dict.getArray('Decode', 'D')); }; - NativeImageDecoder.isDecodable = function NativeImageDecoder_isDecodable(image, xref, res) { + NativeImageDecoder.isDecodable = function (image, xref, res, pdfFunctionFactory) { var dict = image.dict; if (dict.has('DecodeParms') || dict.has('DP')) { return false; } - var cs = _colorspace.ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res); + var cs = _colorspace.ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res, pdfFunctionFactory); return (cs.numComps === 1 || cs.numComps === 3) && cs.isDefaultDecode(dict.getArray('Decode', 'D')); }; - function PartialEvaluator({ pdfManager, xref, handler, pageIndex, idFactory, fontCache, builtInCMapCache, options = null }) { + function PartialEvaluator({ pdfManager, xref, handler, pageIndex, idFactory, fontCache, builtInCMapCache, options = null, pdfFunctionFactory }) { this.pdfManager = pdfManager; this.xref = xref; this.handler = handler; @@ -16779,6 +15796,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { this.fontCache = fontCache; this.builtInCMapCache = builtInCMapCache; this.options = options || DefaultPartialEvaluatorOptions; + this.pdfFunctionFactory = pdfFunctionFactory; this.fetchBuiltInCMap = name => { var cachedCMap = this.builtInCMapCache[name]; if (cachedCMap) { @@ -16934,11 +15952,13 @@ var PartialEvaluator = function PartialEvaluatorClosure() { knockout: false }; var groupSubtype = group.get('S'); - var colorSpace; + var colorSpace = null; if ((0, _primitives.isName)(groupSubtype, 'Transparency')) { groupOptions.isolated = group.get('I') || false; groupOptions.knockout = group.get('K') || false; - colorSpace = group.has('CS') ? _colorspace.ColorSpace.parse(group.get('CS'), this.xref, resources) : null; + if (group.has('CS')) { + colorSpace = _colorspace.ColorSpace.parse(group.get('CS'), this.xref, resources, this.pdfFunctionFactory); + } } if (smask && smask.backdrop) { colorSpace = colorSpace || _colorspace.ColorSpace.singletons.rgb; @@ -16981,8 +16001,13 @@ var PartialEvaluator = function PartialEvaluatorClosure() { var bitStrideLength = width + 7 >> 3; var imgArray = image.getBytes(bitStrideLength * height); var decode = dict.getArray('Decode', 'D'); - var inverseDecode = !!decode && decode[0] > 0; - imgData = _image.PDFImage.createMask(imgArray, width, height, image instanceof _stream.DecodeStream, inverseDecode); + imgData = _image.PDFImage.createMask({ + imgArray, + width, + height, + imageIsFromDecodeStream: image instanceof _stream.DecodeStream, + inverseDecode: !!decode && decode[0] > 0 + }); imgData.cached = true; args = [imgData]; operatorList.addOp(_util.OPS.paintImageMaskXObject, args); @@ -16998,7 +16023,12 @@ var PartialEvaluator = function PartialEvaluatorClosure() { var mask = dict.get('Mask') || false; var SMALL_IMAGE_DIMENSIONS = 200; if (inline && !softMask && !mask && !(image instanceof _stream.JpegStream) && w + h < SMALL_IMAGE_DIMENSIONS) { - var imageObj = new _image.PDFImage(this.xref, resources, image, inline, null, null); + let imageObj = new _image.PDFImage({ + xref: this.xref, + res: resources, + image, + pdfFunctionFactory: this.pdfFunctionFactory + }); imgData = imageObj.createImageData(true); operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]); return; @@ -17007,7 +16037,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { var objId = 'img_' + this.idFactory.createObjId(); operatorList.addDependency(objId); args = [objId, w, h]; - if (nativeImageDecoderSupport !== _util.NativeImageDecoding.NONE && !softMask && !mask && image instanceof _stream.JpegStream && NativeImageDecoder.isSupported(image, this.xref, resources)) { + if (nativeImageDecoderSupport !== _util.NativeImageDecoding.NONE && !softMask && !mask && image instanceof _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) { @@ -17020,9 +16050,22 @@ var PartialEvaluator = function PartialEvaluatorClosure() { } var nativeImageDecoder = null; if (nativeImageDecoderSupport === _util.NativeImageDecoding.DECODE && (image instanceof _stream.JpegStream || mask instanceof _stream.JpegStream || softMask instanceof _stream.JpegStream)) { - nativeImageDecoder = new NativeImageDecoder(this.xref, resources, this.handler, this.options.forceDataSchema); + nativeImageDecoder = new NativeImageDecoder({ + xref: this.xref, + resources, + handler: this.handler, + forceDataSchema: this.options.forceDataSchema, + pdfFunctionFactory: this.pdfFunctionFactory + }); } - _image.PDFImage.buildImage(this.handler, this.xref, resources, image, inline, nativeImageDecoder).then(imageObj => { + _image.PDFImage.buildImage({ + handler: this.handler, + xref: this.xref, + res: resources, + image, + nativeDecoder: nativeImageDecoder, + pdfFunctionFactory: this.pdfFunctionFactory + }).then(imageObj => { var imgData = imageObj.createImageData(false); this.handler.send('obj', [objId, this.pageIndex, 'Image', imgData], [imgData.data.buffer]); }).catch(reason => { @@ -17045,7 +16088,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { }; var transferObj = smask.get('TR'); if ((0, _function.isPDFFunction)(transferObj)) { - var transferFn = _function.PDFFunction.parse(this.xref, transferObj); + let transferFn = this.pdfFunctionFactory.create(transferObj); var transferMap = new Uint8Array(256); var tmp = new Float32Array(1); for (var i = 0; i < 256; i++) { @@ -17324,7 +16367,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { } else if (typeNum === SHADING_PATTERN) { var shading = dict.get('Shading'); var matrix = dict.getArray('Matrix'); - pattern = _pattern.Pattern.parseShading(shading, matrix, this.xref, resources, this.handler); + pattern = _pattern.Pattern.parseShading(shading, matrix, this.xref, resources, this.handler, this.pdfFunctionFactory); operatorList.addOp(fn, pattern.getIR()); return Promise.resolve(); } @@ -17470,10 +16513,10 @@ var PartialEvaluator = function PartialEvaluatorClosure() { stateManager.state.textRenderingMode = args[0]; break; case _util.OPS.setFillColorSpace: - stateManager.state.fillColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources); + stateManager.state.fillColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources, self.pdfFunctionFactory); continue; case _util.OPS.setStrokeColorSpace: - stateManager.state.strokeColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources); + stateManager.state.strokeColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources, self.pdfFunctionFactory); continue; case _util.OPS.setFillColor: cs = stateManager.state.fillColorSpace; @@ -17540,7 +16583,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { if (!shading) { throw new _util.FormatError('No shading object found'); } - var shadingFill = _pattern.Pattern.parseShading(shading, null, xref, resources, self.handler); + var shadingFill = _pattern.Pattern.parseShading(shading, null, xref, resources, self.handler, self.pdfFunctionFactory); var patternIR = shadingFill.getIR(); args = [patternIR]; fn = _util.OPS.shadingFill; @@ -19675,7 +18718,7 @@ exports.OperatorList = OperatorList; exports.PartialEvaluator = PartialEvaluator; /***/ }), -/* 14 */ +/* 13 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -19688,7 +18731,7 @@ exports.CFFCompiler = exports.CFFPrivateDict = exports.CFFTopDict = exports.CFFC var _util = __w_pdfjs_require__(0); -var _charsets = __w_pdfjs_require__(29); +var _charsets = __w_pdfjs_require__(28); var _encodings = __w_pdfjs_require__(4); @@ -21095,7 +20138,7 @@ exports.CFFPrivateDict = CFFPrivateDict; exports.CFFCompiler = CFFCompiler; /***/ }), -/* 15 */ +/* 14 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -21746,7 +20789,7 @@ exports.getGlyphMapForStandardFonts = getGlyphMapForStandardFonts; exports.getSupplementalGlyphMapForArialBlack = getSupplementalGlyphMapForArialBlack; /***/ }), -/* 16 */ +/* 15 */ /***/ (function(module, exports, __w_pdfjs_require__) { var getLookupTableFactory = __w_pdfjs_require__(0).getLookupTableFactory; @@ -23720,6 +22763,1062 @@ exports.getUnicodeRangeFor = getUnicodeRangeFor; exports.getNormalizedUnicodes = getNormalizedUnicodes; exports.getUnicodeForGlyph = getUnicodeForGlyph; +/***/ }), +/* 16 */ +/***/ (function(module, exports, __w_pdfjs_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PostScriptCompiler = exports.PostScriptEvaluator = exports.PDFFunctionFactory = exports.isPDFFunction = undefined; + +var _util = __w_pdfjs_require__(0); + +var _primitives = __w_pdfjs_require__(1); + +var _ps_parser = __w_pdfjs_require__(34); + +let IsEvalSupportedCached = { + get value() { + return (0, _util.shadow)(this, 'value', (0, _util.isEvalSupported)()); + } +}; +class PDFFunctionFactory { + constructor({ xref, isEvalSupported = true }) { + this.xref = xref; + this.isEvalSupported = isEvalSupported !== false; + } + create(fn) { + return PDFFunction.parse({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + fn + }); + } + createFromArray(fnObj) { + return PDFFunction.parseArray({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + fnObj + }); + } + createFromIR(IR) { + return PDFFunction.fromIR({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + IR + }); + } + createIR(fn) { + return PDFFunction.getIR({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + fn + }); + } +} +var PDFFunction = function PDFFunctionClosure() { + const CONSTRUCT_SAMPLED = 0; + const CONSTRUCT_INTERPOLATED = 2; + const CONSTRUCT_STICHED = 3; + const CONSTRUCT_POSTSCRIPT = 4; + return { + getSampleArray(size, outputSize, bps, stream) { + var i, ii; + var length = 1; + for (i = 0, ii = size.length; i < ii; i++) { + length *= size[i]; + } + length *= outputSize; + var array = new Array(length); + var codeSize = 0; + var codeBuf = 0; + var sampleMul = 1.0 / (Math.pow(2.0, bps) - 1); + var strBytes = stream.getBytes((length * bps + 7) / 8); + var strIdx = 0; + for (i = 0; i < length; i++) { + while (codeSize < bps) { + codeBuf <<= 8; + codeBuf |= strBytes[strIdx++]; + codeSize += 8; + } + codeSize -= bps; + array[i] = (codeBuf >> codeSize) * sampleMul; + codeBuf &= (1 << codeSize) - 1; + } + return array; + }, + getIR({ xref, isEvalSupported, fn }) { + var dict = fn.dict; + if (!dict) { + dict = fn; + } + var types = [this.constructSampled, null, this.constructInterpolated, this.constructStiched, this.constructPostScript]; + var typeNum = dict.get('FunctionType'); + var typeFn = types[typeNum]; + if (!typeFn) { + throw new _util.FormatError('Unknown type of function'); + } + return typeFn.call(this, { + xref, + isEvalSupported, + fn, + dict + }); + }, + fromIR({ xref, isEvalSupported, IR }) { + var type = IR[0]; + switch (type) { + case CONSTRUCT_SAMPLED: + return this.constructSampledFromIR({ + xref, + isEvalSupported, + IR + }); + case CONSTRUCT_INTERPOLATED: + return this.constructInterpolatedFromIR({ + xref, + isEvalSupported, + IR + }); + case CONSTRUCT_STICHED: + return this.constructStichedFromIR({ + xref, + isEvalSupported, + IR + }); + default: + return this.constructPostScriptFromIR({ + xref, + isEvalSupported, + IR + }); + } + }, + parse({ xref, isEvalSupported, fn }) { + let IR = this.getIR({ + xref, + isEvalSupported, + fn + }); + return this.fromIR({ + xref, + isEvalSupported, + IR + }); + }, + parseArray({ xref, isEvalSupported, fnObj }) { + if (!Array.isArray(fnObj)) { + return this.parse({ + xref, + isEvalSupported, + fn: fnObj + }); + } + var fnArray = []; + for (var j = 0, jj = fnObj.length; j < jj; j++) { + fnArray.push(this.parse({ + xref, + isEvalSupported, + fn: xref.fetchIfRef(fnObj[j]) + })); + } + return function (src, srcOffset, dest, destOffset) { + for (var i = 0, ii = fnArray.length; i < ii; i++) { + fnArray[i](src, srcOffset, dest, destOffset + i); + } + }; + }, + constructSampled({ xref, isEvalSupported, fn, dict }) { + function toMultiArray(arr) { + var inputLength = arr.length; + var out = []; + var index = 0; + for (var i = 0; i < inputLength; i += 2) { + out[index] = [arr[i], arr[i + 1]]; + ++index; + } + return out; + } + var domain = dict.getArray('Domain'); + var range = dict.getArray('Range'); + if (!domain || !range) { + throw new _util.FormatError('No domain or range'); + } + var inputSize = domain.length / 2; + var outputSize = range.length / 2; + domain = toMultiArray(domain); + range = toMultiArray(range); + var size = dict.get('Size'); + var bps = dict.get('BitsPerSample'); + var order = dict.get('Order') || 1; + if (order !== 1) { + (0, _util.info)('No support for cubic spline interpolation: ' + order); + } + var encode = dict.getArray('Encode'); + if (!encode) { + encode = []; + for (var i = 0; i < inputSize; ++i) { + encode.push(0); + encode.push(size[i] - 1); + } + } + encode = toMultiArray(encode); + var decode = dict.getArray('Decode'); + if (!decode) { + decode = range; + } else { + decode = toMultiArray(decode); + } + var samples = this.getSampleArray(size, outputSize, bps, fn); + return [CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, outputSize, Math.pow(2, bps) - 1, range]; + }, + constructSampledFromIR({ xref, isEvalSupported, IR }) { + function interpolate(x, xmin, xmax, ymin, ymax) { + return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); + } + return function constructSampledFromIRResult(src, srcOffset, dest, destOffset) { + var m = IR[1]; + var domain = IR[2]; + var encode = IR[3]; + var decode = IR[4]; + var samples = IR[5]; + var size = IR[6]; + var n = IR[7]; + var range = IR[9]; + var cubeVertices = 1 << m; + var cubeN = new Float64Array(cubeVertices); + var cubeVertex = new Uint32Array(cubeVertices); + var i, j; + for (j = 0; j < cubeVertices; j++) { + cubeN[j] = 1; + } + var k = n, + pos = 1; + for (i = 0; i < m; ++i) { + var domain_2i = domain[i][0]; + var domain_2i_1 = domain[i][1]; + var xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); + var e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); + var size_i = size[i]; + e = Math.min(Math.max(e, 0), size_i - 1); + var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; + var n0 = e0 + 1 - e; + var n1 = e - e0; + var offset0 = e0 * k; + var offset1 = offset0 + k; + for (j = 0; j < cubeVertices; j++) { + if (j & pos) { + cubeN[j] *= n1; + cubeVertex[j] += offset1; + } else { + cubeN[j] *= n0; + cubeVertex[j] += offset0; + } + } + k *= size_i; + pos <<= 1; + } + for (j = 0; j < n; ++j) { + var rj = 0; + for (i = 0; i < cubeVertices; i++) { + rj += samples[cubeVertex[i] + j] * cubeN[i]; + } + rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); + dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); + } + }; + }, + constructInterpolated({ xref, isEvalSupported, fn, dict }) { + var c0 = dict.getArray('C0') || [0]; + var c1 = dict.getArray('C1') || [1]; + var n = dict.get('N'); + if (!Array.isArray(c0) || !Array.isArray(c1)) { + throw new _util.FormatError('Illegal dictionary for interpolated function'); + } + var length = c0.length; + var diff = []; + for (var i = 0; i < length; ++i) { + diff.push(c1[i] - c0[i]); + } + return [CONSTRUCT_INTERPOLATED, c0, diff, n]; + }, + constructInterpolatedFromIR({ xref, isEvalSupported, IR }) { + var c0 = IR[1]; + var diff = IR[2]; + var n = IR[3]; + var length = diff.length; + return function constructInterpolatedFromIRResult(src, srcOffset, dest, destOffset) { + var x = n === 1 ? src[srcOffset] : Math.pow(src[srcOffset], n); + for (var j = 0; j < length; ++j) { + dest[destOffset + j] = c0[j] + x * diff[j]; + } + }; + }, + constructStiched({ xref, isEvalSupported, fn, dict }) { + var domain = dict.getArray('Domain'); + if (!domain) { + throw new _util.FormatError('No domain'); + } + var inputSize = domain.length / 2; + if (inputSize !== 1) { + throw new _util.FormatError('Bad domain for stiched function'); + } + var fnRefs = dict.get('Functions'); + var fns = []; + for (var i = 0, ii = fnRefs.length; i < ii; ++i) { + fns.push(this.getIR({ + xref, + isEvalSupported, + fn: xref.fetchIfRef(fnRefs[i]) + })); + } + var bounds = dict.getArray('Bounds'); + var encode = dict.getArray('Encode'); + return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; + }, + constructStichedFromIR({ xref, isEvalSupported, IR }) { + var domain = IR[1]; + var bounds = IR[2]; + var encode = IR[3]; + var fnsIR = IR[4]; + var fns = []; + var tmpBuf = new Float32Array(1); + for (var i = 0, ii = fnsIR.length; i < ii; i++) { + fns.push(this.fromIR({ + xref, + isEvalSupported, + IR: fnsIR[i] + })); + } + return function constructStichedFromIRResult(src, srcOffset, dest, destOffset) { + var clip = function constructStichedFromIRClip(v, min, max) { + if (v > max) { + v = max; + } else if (v < min) { + v = min; + } + return v; + }; + var v = clip(src[srcOffset], domain[0], domain[1]); + for (var i = 0, ii = bounds.length; i < ii; ++i) { + if (v < bounds[i]) { + break; + } + } + var dmin = domain[0]; + if (i > 0) { + dmin = bounds[i - 1]; + } + var dmax = domain[1]; + if (i < bounds.length) { + dmax = bounds[i]; + } + var rmin = encode[2 * i]; + var rmax = encode[2 * i + 1]; + tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); + fns[i](tmpBuf, 0, dest, destOffset); + }; + }, + constructPostScript({ xref, isEvalSupported, fn, dict }) { + var domain = dict.getArray('Domain'); + var range = dict.getArray('Range'); + if (!domain) { + throw new _util.FormatError('No domain.'); + } + if (!range) { + throw new _util.FormatError('No range.'); + } + var lexer = new _ps_parser.PostScriptLexer(fn); + var parser = new _ps_parser.PostScriptParser(lexer); + var code = parser.parse(); + return [CONSTRUCT_POSTSCRIPT, domain, range, code]; + }, + constructPostScriptFromIR({ xref, isEvalSupported, IR }) { + var domain = IR[1]; + var range = IR[2]; + var code = IR[3]; + if (isEvalSupported && IsEvalSupportedCached.value) { + let compiled = new PostScriptCompiler().compile(code, domain, range); + if (compiled) { + return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled); + } + } + (0, _util.info)('Unable to compile PS function'); + var numOutputs = range.length >> 1; + var numInputs = domain.length >> 1; + var evaluator = new PostScriptEvaluator(code); + var cache = Object.create(null); + var MAX_CACHE_SIZE = 2048 * 4; + var cache_available = MAX_CACHE_SIZE; + var tmpBuf = new Float32Array(numInputs); + return function constructPostScriptFromIRResult(src, srcOffset, dest, destOffset) { + var i, value; + var key = ''; + var input = tmpBuf; + for (i = 0; i < numInputs; i++) { + value = src[srcOffset + i]; + input[i] = value; + key += value + '_'; + } + var cachedValue = cache[key]; + if (cachedValue !== undefined) { + dest.set(cachedValue, destOffset); + return; + } + var output = new Float32Array(numOutputs); + var stack = evaluator.execute(input); + var stackIndex = stack.length - numOutputs; + for (i = 0; i < numOutputs; i++) { + value = stack[stackIndex + i]; + var bound = range[i * 2]; + if (value < bound) { + value = bound; + } else { + bound = range[i * 2 + 1]; + if (value > bound) { + value = bound; + } + } + output[i] = value; + } + if (cache_available > 0) { + cache_available--; + cache[key] = output; + } + dest.set(output, destOffset); + }; + } + }; +}(); +function isPDFFunction(v) { + var fnDict; + if (typeof v !== 'object') { + return false; + } else if ((0, _primitives.isDict)(v)) { + fnDict = v; + } else if ((0, _primitives.isStream)(v)) { + fnDict = v.dict; + } else { + return false; + } + return fnDict.has('FunctionType'); +} +var PostScriptStack = function PostScriptStackClosure() { + var MAX_STACK_SIZE = 100; + function PostScriptStack(initialStack) { + this.stack = !initialStack ? [] : Array.prototype.slice.call(initialStack, 0); + } + PostScriptStack.prototype = { + push: function PostScriptStack_push(value) { + if (this.stack.length >= MAX_STACK_SIZE) { + throw new Error('PostScript function stack overflow.'); + } + this.stack.push(value); + }, + pop: function PostScriptStack_pop() { + if (this.stack.length <= 0) { + throw new Error('PostScript function stack underflow.'); + } + return this.stack.pop(); + }, + copy: function PostScriptStack_copy(n) { + if (this.stack.length + n >= MAX_STACK_SIZE) { + throw new Error('PostScript function stack overflow.'); + } + var stack = this.stack; + for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { + stack.push(stack[i]); + } + }, + index: function PostScriptStack_index(n) { + this.push(this.stack[this.stack.length - n - 1]); + }, + roll: function PostScriptStack_roll(n, p) { + var stack = this.stack; + var l = stack.length - n; + var r = stack.length - 1, + c = l + (p - Math.floor(p / n) * n), + i, + j, + t; + for (i = l, j = r; i < j; i++, j--) { + t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + for (i = l, j = c - 1; i < j; i++, j--) { + t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + for (i = c, j = r; i < j; i++, j--) { + t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + } + }; + return PostScriptStack; +}(); +var PostScriptEvaluator = function PostScriptEvaluatorClosure() { + function PostScriptEvaluator(operators) { + this.operators = operators; + } + PostScriptEvaluator.prototype = { + execute: function PostScriptEvaluator_execute(initialStack) { + var stack = new PostScriptStack(initialStack); + var counter = 0; + var operators = this.operators; + var length = operators.length; + var operator, a, b; + while (counter < length) { + operator = operators[counter++]; + if (typeof operator === 'number') { + stack.push(operator); + continue; + } + switch (operator) { + case 'jz': + b = stack.pop(); + a = stack.pop(); + if (!a) { + counter = b; + } + break; + case 'j': + a = stack.pop(); + counter = a; + break; + case 'abs': + a = stack.pop(); + stack.push(Math.abs(a)); + break; + case 'add': + b = stack.pop(); + a = stack.pop(); + stack.push(a + b); + break; + case 'and': + b = stack.pop(); + a = stack.pop(); + if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { + stack.push(a && b); + } else { + stack.push(a & b); + } + break; + case 'atan': + a = stack.pop(); + stack.push(Math.atan(a)); + break; + case 'bitshift': + b = stack.pop(); + a = stack.pop(); + if (a > 0) { + stack.push(a << b); + } else { + stack.push(a >> b); + } + break; + case 'ceiling': + a = stack.pop(); + stack.push(Math.ceil(a)); + break; + case 'copy': + a = stack.pop(); + stack.copy(a); + break; + case 'cos': + a = stack.pop(); + stack.push(Math.cos(a)); + break; + case 'cvi': + a = stack.pop() | 0; + stack.push(a); + break; + case 'cvr': + break; + case 'div': + b = stack.pop(); + a = stack.pop(); + stack.push(a / b); + break; + case 'dup': + stack.copy(1); + break; + case 'eq': + b = stack.pop(); + a = stack.pop(); + stack.push(a === b); + break; + case 'exch': + stack.roll(2, 1); + break; + case 'exp': + b = stack.pop(); + a = stack.pop(); + stack.push(Math.pow(a, b)); + break; + case 'false': + stack.push(false); + break; + case 'floor': + a = stack.pop(); + stack.push(Math.floor(a)); + break; + case 'ge': + b = stack.pop(); + a = stack.pop(); + stack.push(a >= b); + break; + case 'gt': + b = stack.pop(); + a = stack.pop(); + stack.push(a > b); + break; + case 'idiv': + b = stack.pop(); + a = stack.pop(); + stack.push(a / b | 0); + break; + case 'index': + a = stack.pop(); + stack.index(a); + break; + case 'le': + b = stack.pop(); + a = stack.pop(); + stack.push(a <= b); + break; + case 'ln': + a = stack.pop(); + stack.push(Math.log(a)); + break; + case 'log': + a = stack.pop(); + stack.push(Math.log(a) / Math.LN10); + break; + case 'lt': + b = stack.pop(); + a = stack.pop(); + stack.push(a < b); + break; + case 'mod': + b = stack.pop(); + a = stack.pop(); + stack.push(a % b); + break; + case 'mul': + b = stack.pop(); + a = stack.pop(); + stack.push(a * b); + break; + case 'ne': + b = stack.pop(); + a = stack.pop(); + stack.push(a !== b); + break; + case 'neg': + a = stack.pop(); + stack.push(-a); + break; + case 'not': + a = stack.pop(); + if ((0, _util.isBool)(a)) { + stack.push(!a); + } else { + stack.push(~a); + } + break; + case 'or': + b = stack.pop(); + a = stack.pop(); + if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { + stack.push(a || b); + } else { + stack.push(a | b); + } + break; + case 'pop': + stack.pop(); + break; + case 'roll': + b = stack.pop(); + a = stack.pop(); + stack.roll(a, b); + break; + case 'round': + a = stack.pop(); + stack.push(Math.round(a)); + break; + case 'sin': + a = stack.pop(); + stack.push(Math.sin(a)); + break; + case 'sqrt': + a = stack.pop(); + stack.push(Math.sqrt(a)); + break; + case 'sub': + b = stack.pop(); + a = stack.pop(); + stack.push(a - b); + break; + case 'true': + stack.push(true); + break; + case 'truncate': + a = stack.pop(); + a = a < 0 ? Math.ceil(a) : Math.floor(a); + stack.push(a); + break; + case 'xor': + b = stack.pop(); + a = stack.pop(); + if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { + stack.push(a !== b); + } else { + stack.push(a ^ b); + } + break; + default: + throw new _util.FormatError(`Unknown operator ${operator}`); + } + } + return stack.stack; + } + }; + return PostScriptEvaluator; +}(); +var PostScriptCompiler = function PostScriptCompilerClosure() { + function AstNode(type) { + this.type = type; + } + AstNode.prototype.visit = function (visitor) { + throw new Error('abstract method'); + }; + function AstArgument(index, min, max) { + AstNode.call(this, 'args'); + this.index = index; + this.min = min; + this.max = max; + } + AstArgument.prototype = Object.create(AstNode.prototype); + AstArgument.prototype.visit = function (visitor) { + visitor.visitArgument(this); + }; + function AstLiteral(number) { + AstNode.call(this, 'literal'); + this.number = number; + this.min = number; + this.max = number; + } + AstLiteral.prototype = Object.create(AstNode.prototype); + AstLiteral.prototype.visit = function (visitor) { + visitor.visitLiteral(this); + }; + function AstBinaryOperation(op, arg1, arg2, min, max) { + AstNode.call(this, 'binary'); + this.op = op; + this.arg1 = arg1; + this.arg2 = arg2; + this.min = min; + this.max = max; + } + AstBinaryOperation.prototype = Object.create(AstNode.prototype); + AstBinaryOperation.prototype.visit = function (visitor) { + visitor.visitBinaryOperation(this); + }; + function AstMin(arg, max) { + AstNode.call(this, 'max'); + this.arg = arg; + this.min = arg.min; + this.max = max; + } + AstMin.prototype = Object.create(AstNode.prototype); + AstMin.prototype.visit = function (visitor) { + visitor.visitMin(this); + }; + function AstVariable(index, min, max) { + AstNode.call(this, 'var'); + this.index = index; + this.min = min; + this.max = max; + } + AstVariable.prototype = Object.create(AstNode.prototype); + AstVariable.prototype.visit = function (visitor) { + visitor.visitVariable(this); + }; + function AstVariableDefinition(variable, arg) { + AstNode.call(this, 'definition'); + this.variable = variable; + this.arg = arg; + } + AstVariableDefinition.prototype = Object.create(AstNode.prototype); + AstVariableDefinition.prototype.visit = function (visitor) { + visitor.visitVariableDefinition(this); + }; + function ExpressionBuilderVisitor() { + this.parts = []; + } + ExpressionBuilderVisitor.prototype = { + visitArgument(arg) { + this.parts.push('Math.max(', arg.min, ', Math.min(', arg.max, ', src[srcOffset + ', arg.index, ']))'); + }, + visitVariable(variable) { + this.parts.push('v', variable.index); + }, + visitLiteral(literal) { + this.parts.push(literal.number); + }, + visitBinaryOperation(operation) { + this.parts.push('('); + operation.arg1.visit(this); + this.parts.push(' ', operation.op, ' '); + operation.arg2.visit(this); + this.parts.push(')'); + }, + visitVariableDefinition(definition) { + this.parts.push('var '); + definition.variable.visit(this); + this.parts.push(' = '); + definition.arg.visit(this); + this.parts.push(';'); + }, + visitMin(max) { + this.parts.push('Math.min('); + max.arg.visit(this); + this.parts.push(', ', max.max, ')'); + }, + toString() { + return this.parts.join(''); + } + }; + function buildAddOperation(num1, num2) { + if (num2.type === 'literal' && num2.number === 0) { + return num1; + } + if (num1.type === 'literal' && num1.number === 0) { + return num2; + } + if (num2.type === 'literal' && num1.type === 'literal') { + return new AstLiteral(num1.number + num2.number); + } + return new AstBinaryOperation('+', num1, num2, num1.min + num2.min, num1.max + num2.max); + } + function buildMulOperation(num1, num2) { + if (num2.type === 'literal') { + if (num2.number === 0) { + return new AstLiteral(0); + } else if (num2.number === 1) { + return num1; + } else if (num1.type === 'literal') { + return new AstLiteral(num1.number * num2.number); + } + } + if (num1.type === 'literal') { + if (num1.number === 0) { + return new AstLiteral(0); + } else if (num1.number === 1) { + return num2; + } + } + var min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); + var max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); + return new AstBinaryOperation('*', num1, num2, min, max); + } + function buildSubOperation(num1, num2) { + if (num2.type === 'literal') { + if (num2.number === 0) { + return num1; + } else if (num1.type === 'literal') { + return new AstLiteral(num1.number - num2.number); + } + } + if (num2.type === 'binary' && num2.op === '-' && num1.type === 'literal' && num1.number === 1 && num2.arg1.type === 'literal' && num2.arg1.number === 1) { + return num2.arg2; + } + return new AstBinaryOperation('-', num1, num2, num1.min - num2.max, num1.max - num2.min); + } + function buildMinOperation(num1, max) { + if (num1.min >= max) { + return new AstLiteral(max); + } else if (num1.max <= max) { + return num1; + } + return new AstMin(num1, max); + } + function PostScriptCompiler() {} + PostScriptCompiler.prototype = { + compile: function PostScriptCompiler_compile(code, domain, range) { + var stack = []; + var i, ii; + var instructions = []; + var inputSize = domain.length >> 1, + outputSize = range.length >> 1; + var lastRegister = 0; + var n, j; + var num1, num2, ast1, ast2, tmpVar, item; + for (i = 0; i < inputSize; i++) { + stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); + } + for (i = 0, ii = code.length; i < ii; i++) { + item = code[i]; + if (typeof item === 'number') { + stack.push(new AstLiteral(item)); + continue; + } + switch (item) { + case 'add': + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildAddOperation(num1, num2)); + break; + case 'cvr': + if (stack.length < 1) { + return null; + } + break; + case 'mul': + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildMulOperation(num1, num2)); + break; + case 'sub': + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildSubOperation(num1, num2)); + break; + case 'exch': + if (stack.length < 2) { + return null; + } + ast1 = stack.pop(); + ast2 = stack.pop(); + stack.push(ast1, ast2); + break; + case 'pop': + if (stack.length < 1) { + return null; + } + stack.pop(); + break; + case 'index': + if (stack.length < 1) { + return null; + } + num1 = stack.pop(); + if (num1.type !== 'literal') { + return null; + } + n = num1.number; + if (n < 0 || !Number.isInteger(n) || stack.length < n) { + return null; + } + ast1 = stack[stack.length - n - 1]; + if (ast1.type === 'literal' || ast1.type === 'var') { + stack.push(ast1); + break; + } + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - n - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); + break; + case 'dup': + if (stack.length < 1) { + return null; + } + if (typeof code[i + 1] === 'number' && code[i + 2] === 'gt' && code[i + 3] === i + 7 && code[i + 4] === 'jz' && code[i + 5] === 'pop' && code[i + 6] === code[i + 1]) { + num1 = stack.pop(); + stack.push(buildMinOperation(num1, code[i + 1])); + i += 6; + break; + } + ast1 = stack[stack.length - 1]; + if (ast1.type === 'literal' || ast1.type === 'var') { + stack.push(ast1); + break; + } + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); + break; + case 'roll': + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + if (num2.type !== 'literal' || num1.type !== 'literal') { + return null; + } + j = num2.number; + n = num1.number; + if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { + return null; + } + j = (j % n + n) % n; + if (j === 0) { + break; + } + Array.prototype.push.apply(stack, stack.splice(stack.length - n, n - j)); + break; + default: + return null; + } + } + if (stack.length !== outputSize) { + return null; + } + var result = []; + instructions.forEach(function (instruction) { + var statementBuilder = new ExpressionBuilderVisitor(); + instruction.visit(statementBuilder); + result.push(statementBuilder.toString()); + }); + stack.forEach(function (expr, i) { + var statementBuilder = new ExpressionBuilderVisitor(); + expr.visit(statementBuilder); + var min = range[i * 2], + max = range[i * 2 + 1]; + var out = [statementBuilder.toString()]; + if (min > expr.min) { + out.unshift('Math.max(', min, ', '); + out.push(')'); + } + if (max < expr.max) { + out.unshift('Math.min(', max, ', '); + out.push(')'); + } + out.unshift('dest[destOffset + ', i, '] = '); + out.push(';'); + result.push(out.join('')); + }); + return result.join('\n'); + } + }; + return PostScriptCompiler; +}(); +exports.isPDFFunction = isPDFFunction; +exports.PDFFunctionFactory = PDFFunctionFactory; +exports.PostScriptEvaluator = PostScriptEvaluator; +exports.PostScriptCompiler = PostScriptCompiler; + /***/ }), /* 17 */ /***/ (function(module, exports, __w_pdfjs_require__) { @@ -23727,8 +23826,8 @@ exports.getUnicodeForGlyph = getUnicodeForGlyph; "use strict"; -var pdfjsVersion = '1.9.597'; -var pdfjsBuild = 'f3987bba'; +var pdfjsVersion = '1.9.607'; +var pdfjsBuild = 'b3f84112'; var pdfjsCoreWorker = __w_pdfjs_require__(18); exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler; @@ -23922,6 +24021,11 @@ var WorkerMessageHandler = { var terminated = false; var cancelXHRs = null; var WorkerTasks = []; + let apiVersion = docParams.apiVersion; + let workerVersion = '1.9.607'; + if (apiVersion !== null && apiVersion !== workerVersion) { + throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); + } var docId = docParams.docId; var docBaseUrl = docParams.docBaseUrl; var workerHandlerName = docParams.docId + '_worker'; @@ -27369,7 +27473,7 @@ exports.NetworkPdfManager = exports.LocalPdfManager = undefined; var _util = __w_pdfjs_require__(0); -var _chunked_stream = __w_pdfjs_require__(8); +var _chunked_stream = __w_pdfjs_require__(7); var _document = __w_pdfjs_require__(23); @@ -27551,7 +27655,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.PDFDocument = exports.Page = undefined; -var _obj = __w_pdfjs_require__(9); +var _obj = __w_pdfjs_require__(8); var _primitives = __w_pdfjs_require__(1); @@ -27559,15 +27663,15 @@ var _util = __w_pdfjs_require__(0); var _stream = __w_pdfjs_require__(2); -var _evaluator = __w_pdfjs_require__(13); +var _evaluator = __w_pdfjs_require__(12); var _annotation = __w_pdfjs_require__(37); -var _crypto = __w_pdfjs_require__(12); +var _crypto = __w_pdfjs_require__(11); var _parser = __w_pdfjs_require__(5); -var _function = __w_pdfjs_require__(6); +var _function = __w_pdfjs_require__(16); var Page = function PageClosure() { var DEFAULT_USER_UNIT = 1.0; @@ -27575,7 +27679,7 @@ var Page = function PageClosure() { function isAnnotationRenderable(annotation, intent) { return intent === 'display' && annotation.viewable || intent === 'print' && annotation.printable; } - function Page(pdfManager, xref, pageIndex, pageDict, ref, fontCache, builtInCMapCache) { + function Page({ pdfManager, xref, pageIndex, pageDict, ref, fontCache, builtInCMapCache, pdfFunctionFactory }) { this.pdfManager = pdfManager; this.pageIndex = pageIndex; this.pageDict = pageDict; @@ -27583,6 +27687,7 @@ var Page = function PageClosure() { this.ref = ref; this.fontCache = fontCache; this.builtInCMapCache = builtInCMapCache; + this.pdfFunctionFactory = pdfFunctionFactory; this.evaluatorOptions = pdfManager.evaluatorOptions; this.resourcesPromise = null; var uniquePrefix = 'p' + this.pageIndex + '_'; @@ -27711,7 +27816,8 @@ var Page = function PageClosure() { idFactory: this.idFactory, fontCache: this.fontCache, builtInCMapCache: this.builtInCMapCache, - options: this.evaluatorOptions + options: this.evaluatorOptions, + pdfFunctionFactory: this.pdfFunctionFactory }); var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); var pageListPromise = dataPromises.then(([contentStream]) => { @@ -27768,7 +27874,8 @@ var Page = function PageClosure() { idFactory: this.idFactory, fontCache: this.fontCache, builtInCMapCache: this.builtInCMapCache, - options: this.evaluatorOptions + options: this.evaluatorOptions, + pdfFunctionFactory: this.pdfFunctionFactory }); return partialEvaluator.getTextContent({ stream: contentStream, @@ -27823,6 +27930,11 @@ var PDFDocument = function PDFDocumentClosure() { this.pdfManager = pdfManager; this.stream = stream; this.xref = new _obj.XRef(stream, pdfManager); + let evaluatorOptions = pdfManager.evaluatorOptions; + this.pdfFunctionFactory = new _function.PDFFunctionFactory({ + xref: this.xref, + isEvalSupported: evaluatorOptions.isEvalSupported + }); } function find(stream, needle, limit, backwards) { var pos = stream.pos; @@ -27972,12 +28084,19 @@ var PDFDocument = function PDFDocumentClosure() { this.xref.parse(recoveryMode); var pageFactory = { createPage: (pageIndex, dict, ref, fontCache, builtInCMapCache) => { - return new Page(this.pdfManager, this.xref, pageIndex, dict, ref, fontCache, builtInCMapCache); + return new Page({ + pdfManager: this.pdfManager, + xref: this.xref, + pageIndex, + pageDict: dict, + ref, + fontCache, + builtInCMapCache, + pdfFunctionFactory: this.pdfFunctionFactory + }); } }; this.catalog = new _obj.Catalog(this.pdfManager, this.xref, pageFactory); - let evaluatorOptions = this.pdfManager.evaluatorOptions; - _function.PDFFunction.setIsEvalSupported(evaluatorOptions.isEvalSupported); }, get numPages() { var linearization = this.linearization; @@ -28059,7 +28178,7 @@ exports.Jbig2Image = undefined; var _util = __w_pdfjs_require__(0); -var _arithmetic_decoder = __w_pdfjs_require__(10); +var _arithmetic_decoder = __w_pdfjs_require__(9); let Jbig2Error = function Jbig2ErrorClosure() { function Jbig2Error(msg) { @@ -30209,210 +30328,6 @@ exports.JpegImage = JpegImage; "use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PostScriptParser = exports.PostScriptLexer = undefined; - -var _util = __w_pdfjs_require__(0); - -var _primitives = __w_pdfjs_require__(1); - -var PostScriptParser = function PostScriptParserClosure() { - function PostScriptParser(lexer) { - this.lexer = lexer; - this.operators = []; - this.token = null; - this.prev = null; - } - PostScriptParser.prototype = { - nextToken: function PostScriptParser_nextToken() { - this.prev = this.token; - this.token = this.lexer.getToken(); - }, - accept: function PostScriptParser_accept(type) { - if (this.token.type === type) { - this.nextToken(); - return true; - } - return false; - }, - expect: function PostScriptParser_expect(type) { - if (this.accept(type)) { - return true; - } - throw new _util.FormatError(`Unexpected symbol: found ${this.token.type} expected ${type}.`); - }, - parse: function PostScriptParser_parse() { - this.nextToken(); - this.expect(PostScriptTokenTypes.LBRACE); - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - return this.operators; - }, - parseBlock: function PostScriptParser_parseBlock() { - while (true) { - if (this.accept(PostScriptTokenTypes.NUMBER)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { - this.operators.push(this.prev.value); - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - this.parseCondition(); - } else { - return; - } - } - }, - parseCondition: function PostScriptParser_parseCondition() { - var conditionLocation = this.operators.length; - this.operators.push(null, null); - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - if (this.accept(PostScriptTokenTypes.IF)) { - this.operators[conditionLocation] = this.operators.length; - this.operators[conditionLocation + 1] = 'jz'; - } else if (this.accept(PostScriptTokenTypes.LBRACE)) { - var jumpLocation = this.operators.length; - this.operators.push(null, null); - var endOfTrue = this.operators.length; - this.parseBlock(); - this.expect(PostScriptTokenTypes.RBRACE); - this.expect(PostScriptTokenTypes.IFELSE); - this.operators[jumpLocation] = this.operators.length; - this.operators[jumpLocation + 1] = 'j'; - this.operators[conditionLocation] = endOfTrue; - this.operators[conditionLocation + 1] = 'jz'; - } else { - throw new _util.FormatError('PS Function: error parsing conditional.'); - } - } - }; - return PostScriptParser; -}(); -var PostScriptTokenTypes = { - LBRACE: 0, - RBRACE: 1, - NUMBER: 2, - OPERATOR: 3, - IF: 4, - IFELSE: 5 -}; -var PostScriptToken = function PostScriptTokenClosure() { - function PostScriptToken(type, value) { - this.type = type; - this.value = value; - } - var opCache = Object.create(null); - PostScriptToken.getOperator = function PostScriptToken_getOperator(op) { - var opValue = opCache[op]; - if (opValue) { - return opValue; - } - return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); - }; - PostScriptToken.LBRACE = new PostScriptToken(PostScriptTokenTypes.LBRACE, '{'); - PostScriptToken.RBRACE = new PostScriptToken(PostScriptTokenTypes.RBRACE, '}'); - PostScriptToken.IF = new PostScriptToken(PostScriptTokenTypes.IF, 'IF'); - PostScriptToken.IFELSE = new PostScriptToken(PostScriptTokenTypes.IFELSE, 'IFELSE'); - return PostScriptToken; -}(); -var PostScriptLexer = function PostScriptLexerClosure() { - function PostScriptLexer(stream) { - this.stream = stream; - this.nextChar(); - this.strBuf = []; - } - PostScriptLexer.prototype = { - nextChar: function PostScriptLexer_nextChar() { - return this.currentChar = this.stream.getByte(); - }, - getToken: function PostScriptLexer_getToken() { - var comment = false; - var ch = this.currentChar; - while (true) { - if (ch < 0) { - return _primitives.EOF; - } - if (comment) { - if (ch === 0x0A || ch === 0x0D) { - comment = false; - } - } else if (ch === 0x25) { - comment = true; - } else if (!(0, _util.isSpace)(ch)) { - break; - } - ch = this.nextChar(); - } - switch (ch | 0) { - case 0x30: - case 0x31: - case 0x32: - case 0x33: - case 0x34: - case 0x35: - case 0x36: - case 0x37: - case 0x38: - case 0x39: - case 0x2B: - case 0x2D: - case 0x2E: - return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); - case 0x7B: - this.nextChar(); - return PostScriptToken.LBRACE; - case 0x7D: - this.nextChar(); - return PostScriptToken.RBRACE; - } - var strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5A || ch >= 0x61 && ch <= 0x7A)) { - strBuf.push(String.fromCharCode(ch)); - } - var str = strBuf.join(''); - switch (str.toLowerCase()) { - case 'if': - return PostScriptToken.IF; - case 'ifelse': - return PostScriptToken.IFELSE; - default: - return PostScriptToken.getOperator(str); - } - }, - getNumber: function PostScriptLexer_getNumber() { - var ch = this.currentChar; - var strBuf = this.strBuf; - strBuf.length = 0; - strBuf[0] = String.fromCharCode(ch); - while ((ch = this.nextChar()) >= 0) { - if (ch >= 0x30 && ch <= 0x39 || ch === 0x2D || ch === 0x2E) { - strBuf.push(String.fromCharCode(ch)); - } else { - break; - } - } - var value = parseFloat(strBuf.join('')); - if (isNaN(value)) { - throw new _util.FormatError(`Invalid floating point number: ${value}`); - } - return value; - } - }; - return PostScriptLexer; -}(); -exports.PostScriptLexer = PostScriptLexer; -exports.PostScriptParser = PostScriptParser; - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __w_pdfjs_require__) { - -"use strict"; - - Object.defineProperty(exports, "__esModule", { value: true }); @@ -31122,7 +31037,7 @@ exports.IdentityCMap = IdentityCMap; exports.CMapFactory = CMapFactory; /***/ }), -/* 28 */ +/* 27 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -31135,21 +31050,21 @@ exports.getFontType = exports.ProblematicCharRanges = exports.IdentityToUnicodeM var _util = __w_pdfjs_require__(0); -var _cff_parser = __w_pdfjs_require__(14); +var _cff_parser = __w_pdfjs_require__(13); -var _glyphlist = __w_pdfjs_require__(7); +var _glyphlist = __w_pdfjs_require__(6); var _encodings = __w_pdfjs_require__(4); -var _standard_fonts = __w_pdfjs_require__(15); +var _standard_fonts = __w_pdfjs_require__(14); -var _unicode = __w_pdfjs_require__(16); +var _unicode = __w_pdfjs_require__(15); -var _font_renderer = __w_pdfjs_require__(30); +var _font_renderer = __w_pdfjs_require__(29); var _stream = __w_pdfjs_require__(2); -var _type1_parser = __w_pdfjs_require__(31); +var _type1_parser = __w_pdfjs_require__(30); var PRIVATE_USE_OFFSET_START = 0xE000; var PRIVATE_USE_OFFSET_END = 0xF8FF; @@ -32204,14 +32119,19 @@ var Font = function FontClosure() { } } function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, hintsValid) { + var glyphProfile = { + length: 0, + sizeOfInstructions: 0 + }; if (sourceEnd - sourceStart <= 12) { - return 0; + return glyphProfile; } var glyf = source.subarray(sourceStart, sourceEnd); var contoursCount = glyf[0] << 8 | glyf[1]; if (contoursCount & 0x8000) { dest.set(glyf, destStart); - return glyf.length; + glyphProfile.length = glyf.length; + return glyphProfile; } var i, j = 10, @@ -32223,6 +32143,7 @@ var Font = function FontClosure() { } var instructionsStart = j; var instructionsLength = glyf[j] << 8 | glyf[j + 1]; + glyphProfile.sizeOfInstructions = instructionsLength; j += 2 + instructionsLength; var instructionsEnd = j; var coordinatesLength = 0; @@ -32240,11 +32161,11 @@ var Font = function FontClosure() { } } if (coordinatesLength === 0) { - return 0; + return glyphProfile; } var glyphDataLength = j + coordinatesLength; if (glyphDataLength > glyf.length) { - return 0; + return glyphProfile; } if (!hintsValid && instructionsLength > 0) { dest.set(glyf.subarray(0, instructionsStart), destStart); @@ -32254,15 +32175,18 @@ var Font = function FontClosure() { if (glyf.length - glyphDataLength > 3) { glyphDataLength = glyphDataLength + 3 & ~3; } - return glyphDataLength; + glyphProfile.length = glyphDataLength; + return glyphProfile; } if (glyf.length - glyphDataLength > 3) { glyphDataLength = glyphDataLength + 3 & ~3; dest.set(glyf.subarray(0, glyphDataLength), destStart); - return glyphDataLength; + glyphProfile.length = glyphDataLength; + return glyphProfile; } dest.set(glyf, destStart); - return glyf.length; + glyphProfile.length = glyf.length; + return glyphProfile; } function sanitizeHead(head, numGlyphs, locaLength) { var data = head.data; @@ -32289,7 +32213,7 @@ var Font = function FontClosure() { } } } - function sanitizeGlyphLocations(loca, glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry) { + function sanitizeGlyphLocations(loca, glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions) { var itemSize, itemDecode, itemEncode; if (isGlyphLocationsLong) { itemSize = 4; @@ -32324,7 +32248,7 @@ var Font = function FontClosure() { var newGlyfData = new Uint8Array(oldGlyfDataLength); var startOffset = itemDecode(locaData, 0); var writeOffset = 0; - var missingGlyphData = Object.create(null); + var missingGlyphs = Object.create(null); itemEncode(locaData, 0, writeOffset); var i, j; var locaCount = dupFirstEntry ? numGlyphs - 1 : numGlyphs; @@ -32336,9 +32260,13 @@ var Font = function FontClosure() { if (endOffset > oldGlyfDataLength) { startOffset = endOffset; } - var newLength = sanitizeGlyph(oldGlyfData, startOffset, endOffset, newGlyfData, writeOffset, hintsValid); + var glyphProfile = sanitizeGlyph(oldGlyfData, startOffset, endOffset, newGlyfData, writeOffset, hintsValid); + var newLength = glyphProfile.length; if (newLength === 0) { - missingGlyphData[i] = true; + missingGlyphs[i] = true; + } + if (glyphProfile.sizeOfInstructions > maxSizeOfInstructions) { + maxSizeOfInstructions = glyphProfile.sizeOfInstructions; } writeOffset += newLength; itemEncode(locaData, j, writeOffset); @@ -32350,9 +32278,7 @@ var Font = function FontClosure() { itemEncode(locaData, j, simpleGlyph.length); } glyf.data = simpleGlyph; - return missingGlyphData; - } - if (dupFirstEntry) { + } else if (dupFirstEntry) { var firstEntryLength = itemDecode(locaData, itemSize); if (newGlyfData.length > firstEntryLength + writeOffset) { glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); @@ -32365,7 +32291,10 @@ var Font = function FontClosure() { } else { glyf.data = newGlyfData.subarray(0, writeOffset); } - return missingGlyphData; + return { + missingGlyphs, + maxSizeOfInstructions + }; } function readPostScriptTable(post, properties, maxpNumGlyphs) { var start = (font.start ? font.start : 0) + post.offset; @@ -32769,6 +32698,7 @@ var Font = function FontClosure() { var version = font.getInt32(); var numGlyphs = font.getUint16(); var maxFunctionDefs = 0; + var maxSizeOfInstructions = 0; if (version >= 0x00010000 && tables['maxp'].length >= 22) { font.pos += 8; var maxZones = font.getUint16(); @@ -32778,6 +32708,8 @@ var Font = function FontClosure() { } font.pos += 4; maxFunctionDefs = font.getUint16(); + font.pos += 6; + maxSizeOfInstructions = font.getUint16(); } var dupFirstEntry = false; if (properties.type === 'CIDFontType2' && properties.toUnicode && properties.toUnicode.get(0) > '\u0000') { @@ -32800,7 +32732,12 @@ var Font = function FontClosure() { var missingGlyphs = Object.create(null); if (isTrueType) { var isGlyphLocationsLong = int16(tables['head'].data[50], tables['head'].data[51]); - missingGlyphs = sanitizeGlyphLocations(tables['loca'], tables['glyf'], numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry); + var glyphsInfo = sanitizeGlyphLocations(tables['loca'], tables['glyf'], numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions); + missingGlyphs = glyphsInfo.missingGlyphs; + if (version >= 0x00010000 && tables['maxp'].length >= 22) { + tables['maxp'].data[26] = glyphsInfo.maxSizeOfInstructions >> 8; + tables['maxp'].data[27] = glyphsInfo.maxSizeOfInstructions & 255; + } } if (!tables['hhea']) { throw new _util.FormatError('Required "hhea" table is not found'); @@ -33570,7 +33507,7 @@ exports.ProblematicCharRanges = ProblematicCharRanges; exports.getFontType = getFontType; /***/ }), -/* 29 */ +/* 28 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -33587,7 +33524,7 @@ exports.ExpertCharset = ExpertCharset; exports.ExpertSubsetCharset = ExpertSubsetCharset; /***/ }), -/* 30 */ +/* 29 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -33600,9 +33537,9 @@ exports.FontRendererFactory = undefined; var _util = __w_pdfjs_require__(0); -var _cff_parser = __w_pdfjs_require__(14); +var _cff_parser = __w_pdfjs_require__(13); -var _glyphlist = __w_pdfjs_require__(7); +var _glyphlist = __w_pdfjs_require__(6); var _encodings = __w_pdfjs_require__(4); @@ -34327,7 +34264,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() { exports.FontRendererFactory = FontRendererFactory; /***/ }), -/* 31 */ +/* 30 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -34880,7 +34817,7 @@ var Type1Parser = function Type1ParserClosure() { exports.Type1Parser = Type1Parser; /***/ }), -/* 32 */ +/* 31 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -34897,8 +34834,6 @@ var _colorspace = __w_pdfjs_require__(3); var _primitives = __w_pdfjs_require__(1); -var _function = __w_pdfjs_require__(6); - var ShadingType = { FUNCTION_BASED: 1, AXIAL: 2, @@ -34917,19 +34852,19 @@ var Pattern = function PatternClosure() { throw new Error(`Should not call Pattern.getStyle: ${ctx}`); } }; - Pattern.parseShading = function Pattern_parseShading(shading, matrix, xref, res, handler) { + Pattern.parseShading = function (shading, matrix, xref, res, handler, pdfFunctionFactory) { var dict = (0, _primitives.isStream)(shading) ? shading.dict : shading; var type = dict.get('ShadingType'); try { switch (type) { case ShadingType.AXIAL: case ShadingType.RADIAL: - return new Shadings.RadialAxial(dict, matrix, xref, res); + return new Shadings.RadialAxial(dict, matrix, xref, res, pdfFunctionFactory); case ShadingType.FREE_FORM_MESH: case ShadingType.LATTICE_FORM_MESH: case ShadingType.COONS_PATCH_MESH: case ShadingType.TENSOR_PATCH_MESH: - return new Shadings.Mesh(shading, matrix, xref, res); + return new Shadings.Mesh(shading, matrix, xref, res, pdfFunctionFactory); default: throw new _util.FormatError('Unsupported ShadingType: ' + type); } @@ -34947,13 +34882,13 @@ var Pattern = function PatternClosure() { var Shadings = {}; Shadings.SMALL_NUMBER = 1e-6; Shadings.RadialAxial = function RadialAxialClosure() { - function RadialAxial(dict, matrix, xref, res) { + function RadialAxial(dict, matrix, xref, res, pdfFunctionFactory) { this.matrix = matrix; this.coordsArr = dict.getArray('Coords'); this.shadingType = dict.get('ShadingType'); this.type = 'Pattern'; var cs = dict.get('ColorSpace', 'CS'); - cs = _colorspace.ColorSpace.parse(cs, xref, res); + cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); this.cs = cs; var t0 = 0.0, t1 = 1.0; @@ -34984,7 +34919,7 @@ Shadings.RadialAxial = function RadialAxialClosure() { this.extendStart = extendStart; this.extendEnd = extendEnd; var fnObj = dict.get('Function'); - var fn = _function.PDFFunction.parseArray(xref, fnObj); + var fn = pdfFunctionFactory.createFromArray(fnObj); var diff = t1 - t0; var step = diff / 10; var colorStops = this.colorStops = []; @@ -35577,7 +35512,7 @@ Shadings.Mesh = function MeshClosure() { } } } - function Mesh(stream, matrix, xref, res) { + function Mesh(stream, matrix, xref, res, pdfFunctionFactory) { if (!(0, _primitives.isStream)(stream)) { throw new _util.FormatError('Mesh data is not a stream'); } @@ -35587,11 +35522,11 @@ Shadings.Mesh = function MeshClosure() { this.type = 'Pattern'; this.bbox = dict.getArray('BBox'); var cs = dict.get('ColorSpace', 'CS'); - cs = _colorspace.ColorSpace.parse(cs, xref, res); + cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); this.cs = cs; this.background = dict.has('Background') ? cs.getRgb(dict.get('Background'), 0) : null; var fnObj = dict.get('Function'); - var fn = fnObj ? _function.PDFFunction.parseArray(xref, fnObj) : null; + var fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null; this.coords = []; this.colors = []; this.figures = []; @@ -35672,7 +35607,7 @@ exports.Pattern = Pattern; exports.getTilingPatternIR = getTilingPatternIR; /***/ }), -/* 33 */ +/* 32 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -35917,7 +35852,7 @@ function bidi(str, startLevel, vertical) { exports.bidi = bidi; /***/ }), -/* 34 */ +/* 33 */ /***/ (function(module, exports, __w_pdfjs_require__) { "use strict"; @@ -38870,6 +38805,210 @@ var getMetrics = (0, _util.getLookupTableFactory)(function (t) { }); exports.getMetrics = getMetrics; +/***/ }), +/* 34 */ +/***/ (function(module, exports, __w_pdfjs_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.PostScriptParser = exports.PostScriptLexer = undefined; + +var _util = __w_pdfjs_require__(0); + +var _primitives = __w_pdfjs_require__(1); + +var PostScriptParser = function PostScriptParserClosure() { + function PostScriptParser(lexer) { + this.lexer = lexer; + this.operators = []; + this.token = null; + this.prev = null; + } + PostScriptParser.prototype = { + nextToken: function PostScriptParser_nextToken() { + this.prev = this.token; + this.token = this.lexer.getToken(); + }, + accept: function PostScriptParser_accept(type) { + if (this.token.type === type) { + this.nextToken(); + return true; + } + return false; + }, + expect: function PostScriptParser_expect(type) { + if (this.accept(type)) { + return true; + } + throw new _util.FormatError(`Unexpected symbol: found ${this.token.type} expected ${type}.`); + }, + parse: function PostScriptParser_parse() { + this.nextToken(); + this.expect(PostScriptTokenTypes.LBRACE); + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + return this.operators; + }, + parseBlock: function PostScriptParser_parseBlock() { + while (true) { + if (this.accept(PostScriptTokenTypes.NUMBER)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { + this.parseCondition(); + } else { + return; + } + } + }, + parseCondition: function PostScriptParser_parseCondition() { + var conditionLocation = this.operators.length; + this.operators.push(null, null); + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + if (this.accept(PostScriptTokenTypes.IF)) { + this.operators[conditionLocation] = this.operators.length; + this.operators[conditionLocation + 1] = 'jz'; + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { + var jumpLocation = this.operators.length; + this.operators.push(null, null); + var endOfTrue = this.operators.length; + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + this.expect(PostScriptTokenTypes.IFELSE); + this.operators[jumpLocation] = this.operators.length; + this.operators[jumpLocation + 1] = 'j'; + this.operators[conditionLocation] = endOfTrue; + this.operators[conditionLocation + 1] = 'jz'; + } else { + throw new _util.FormatError('PS Function: error parsing conditional.'); + } + } + }; + return PostScriptParser; +}(); +var PostScriptTokenTypes = { + LBRACE: 0, + RBRACE: 1, + NUMBER: 2, + OPERATOR: 3, + IF: 4, + IFELSE: 5 +}; +var PostScriptToken = function PostScriptTokenClosure() { + function PostScriptToken(type, value) { + this.type = type; + this.value = value; + } + var opCache = Object.create(null); + PostScriptToken.getOperator = function PostScriptToken_getOperator(op) { + var opValue = opCache[op]; + if (opValue) { + return opValue; + } + return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); + }; + PostScriptToken.LBRACE = new PostScriptToken(PostScriptTokenTypes.LBRACE, '{'); + PostScriptToken.RBRACE = new PostScriptToken(PostScriptTokenTypes.RBRACE, '}'); + PostScriptToken.IF = new PostScriptToken(PostScriptTokenTypes.IF, 'IF'); + PostScriptToken.IFELSE = new PostScriptToken(PostScriptTokenTypes.IFELSE, 'IFELSE'); + return PostScriptToken; +}(); +var PostScriptLexer = function PostScriptLexerClosure() { + function PostScriptLexer(stream) { + this.stream = stream; + this.nextChar(); + this.strBuf = []; + } + PostScriptLexer.prototype = { + nextChar: function PostScriptLexer_nextChar() { + return this.currentChar = this.stream.getByte(); + }, + getToken: function PostScriptLexer_getToken() { + var comment = false; + var ch = this.currentChar; + while (true) { + if (ch < 0) { + return _primitives.EOF; + } + if (comment) { + if (ch === 0x0A || ch === 0x0D) { + comment = false; + } + } else if (ch === 0x25) { + comment = true; + } else if (!(0, _util.isSpace)(ch)) { + break; + } + ch = this.nextChar(); + } + switch (ch | 0) { + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x2B: + case 0x2D: + case 0x2E: + return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); + case 0x7B: + this.nextChar(); + return PostScriptToken.LBRACE; + case 0x7D: + this.nextChar(); + return PostScriptToken.RBRACE; + } + var strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); + while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5A || ch >= 0x61 && ch <= 0x7A)) { + strBuf.push(String.fromCharCode(ch)); + } + var str = strBuf.join(''); + switch (str.toLowerCase()) { + case 'if': + return PostScriptToken.IF; + case 'ifelse': + return PostScriptToken.IFELSE; + default: + return PostScriptToken.getOperator(str); + } + }, + getNumber: function PostScriptLexer_getNumber() { + var ch = this.currentChar; + var strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); + while ((ch = this.nextChar()) >= 0) { + if (ch >= 0x30 && ch <= 0x39 || ch === 0x2D || ch === 0x2E) { + strBuf.push(String.fromCharCode(ch)); + } else { + break; + } + } + var value = parseFloat(strBuf.join('')); + if (isNaN(value)) { + throw new _util.FormatError(`Invalid floating point number: ${value}`); + } + return value; + } + }; + return PostScriptLexer; +}(); +exports.PostScriptLexer = PostScriptLexer; +exports.PostScriptParser = PostScriptParser; + /***/ }), /* 35 */ /***/ (function(module, exports, __w_pdfjs_require__) { @@ -39004,7 +39143,7 @@ var _primitives = __w_pdfjs_require__(1); var _colorspace = __w_pdfjs_require__(3); -var _jpx = __w_pdfjs_require__(11); +var _jpx = __w_pdfjs_require__(10); var PDFImage = function PDFImageClosure() { function handleImageData(image, nativeDecoder) { @@ -39041,7 +39180,7 @@ var PDFImage = function PDFImageClosure() { } return dest; } - function PDFImage(xref, res, image, inline, smask, mask, isMask) { + function PDFImage({ xref, res, image, smask = null, mask = null, isMask = false, pdfFunctionFactory }) { this.image = image; var dict = image.dict; if (dict.has('Filter')) { @@ -39095,7 +39234,7 @@ var PDFImage = function PDFImageClosure() { throw new Error(`JPX images with ${this.numComps} ` + 'color components not supported.'); } } - this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, res); + this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, res, pdfFunctionFactory); this.numComps = this.colorSpace.numComps; } this.decode = dict.getArray('Decode', 'D'); @@ -39113,7 +39252,12 @@ var PDFImage = function PDFImageClosure() { } } if (smask) { - this.smask = new PDFImage(xref, res, smask, false); + this.smask = new PDFImage({ + xref, + res, + image: smask, + pdfFunctionFactory + }); } else if (mask) { if ((0, _primitives.isStream)(mask)) { var maskDict = mask.dict, @@ -39121,14 +39265,20 @@ var PDFImage = function PDFImageClosure() { if (!imageMask) { (0, _util.warn)('Ignoring /Mask in image without /ImageMask.'); } else { - this.mask = new PDFImage(xref, res, mask, false, null, null, true); + this.mask = new PDFImage({ + xref, + res, + image: mask, + isMask: true, + pdfFunctionFactory + }); } } else { this.mask = mask; } } } - PDFImage.buildImage = function PDFImage_buildImage(handler, xref, res, image, inline, nativeDecoder) { + PDFImage.buildImage = function ({ handler, xref, res, image, nativeDecoder = null, pdfFunctionFactory }) { var imagePromise = handleImageData(image, nativeDecoder); var smaskPromise; var maskPromise; @@ -39152,14 +39302,18 @@ var PDFImage = function PDFImageClosure() { maskPromise = Promise.resolve(null); } } - return Promise.all([imagePromise, smaskPromise, maskPromise]).then(function (results) { - var imageData = results[0]; - var smaskData = results[1]; - var maskData = results[2]; - return new PDFImage(xref, res, imageData, inline, smaskData, maskData); + return Promise.all([imagePromise, smaskPromise, maskPromise]).then(function ([imageData, smaskData, maskData]) { + return new PDFImage({ + xref, + res, + image: imageData, + smask: smaskData, + mask: maskData, + pdfFunctionFactory + }); }); }; - PDFImage.createMask = function PDFImage_createMask(imgArray, width, height, imageIsFromDecodeStream, inverseDecode) { + PDFImage.createMask = function ({ imgArray, width, height, imageIsFromDecodeStream, inverseDecode }) { var computedLength = (width + 7 >> 3) * height; var actualLength = imgArray.byteLength; var haveFullData = computedLength === actualLength; @@ -39194,7 +39348,7 @@ var PDFImage = function PDFImageClosure() { get drawHeight() { return Math.max(this.height, this.smask && this.smask.height || 0, this.mask && this.mask.height || 0); }, - decodeBuffer: function PDFImage_decodeBuffer(buffer) { + decodeBuffer(buffer) { var bpc = this.bpc; var numComps = this.numComps; var decodeAddends = this.decodeAddends; @@ -39215,7 +39369,7 @@ var PDFImage = function PDFImageClosure() { } } }, - getComponents: function PDFImage_getComponents(buffer) { + getComponents(buffer) { var bpc = this.bpc; if (bpc === 8) { return buffer; @@ -39278,7 +39432,7 @@ var PDFImage = function PDFImageClosure() { } return output; }, - fillOpacity: function PDFImage_fillOpacity(rgbaBuf, width, height, actualHeight, image) { + fillOpacity(rgbaBuf, width, height, actualHeight, image) { var smask = this.smask; var mask = this.mask; var alphaBuf, sw, sh, i, ii, j; @@ -39333,7 +39487,7 @@ var PDFImage = function PDFImageClosure() { } } }, - undoPreblend: function PDFImage_undoPreblend(buffer, width, height) { + undoPreblend(buffer, width, height) { var matte = this.smask && this.smask.matte; if (!matte) { return; @@ -39361,7 +39515,7 @@ var PDFImage = function PDFImageClosure() { buffer[i + 2] = b <= 0 ? 0 : b >= 255 ? 255 : b | 0; } }, - createImageData: function PDFImage_createImageData(forceRGBA) { + createImageData(forceRGBA = false) { var drawWidth = this.drawWidth; var drawHeight = this.drawHeight; var imgData = { @@ -39431,7 +39585,7 @@ var PDFImage = function PDFImageClosure() { } return imgData; }, - fillGrayBuffer: function PDFImage_fillGrayBuffer(buffer) { + fillGrayBuffer(buffer) { var numComps = this.numComps; if (numComps !== 1) { throw new _util.FormatError(`Reading gray scale from a color image: ${numComps}`); @@ -39465,7 +39619,7 @@ var PDFImage = function PDFImageClosure() { buffer[i] = scale * comps[i] | 0; } }, - getImageBytes: function PDFImage_getImageBytes(length, drawWidth, drawHeight, forceRGB) { + getImageBytes(length, drawWidth, drawHeight, forceRGB = false) { this.image.reset(); this.image.drawWidth = drawWidth || this.width; this.image.drawHeight = drawHeight || this.height; @@ -39491,13 +39645,13 @@ exports.AnnotationFactory = exports.AnnotationBorderStyle = exports.Annotation = var _util = __w_pdfjs_require__(0); -var _obj = __w_pdfjs_require__(9); +var _obj = __w_pdfjs_require__(8); var _primitives = __w_pdfjs_require__(1); var _colorspace = __w_pdfjs_require__(3); -var _evaluator = __w_pdfjs_require__(13); +var _evaluator = __w_pdfjs_require__(12); var _stream = __w_pdfjs_require__(2); diff --git a/browser/themes/osx/browser.css b/browser/themes/osx/browser.css index 4ae1d43674f1..6a634b2a04bc 100644 --- a/browser/themes/osx/browser.css +++ b/browser/themes/osx/browser.css @@ -55,6 +55,11 @@ /** Begin titlebar **/ +#titlebar { + /* Centrally align content items vertically */ + -moz-box-pack: center; +} + #titlebar-content { /* Ensure the the content part of the titlebar does not shrink. */ min-height: inherit; @@ -69,6 +74,8 @@ #titlebar-secondary-buttonbox { position: relative; z-index: 1; + /* Centrally align indicators and full screen button vertically */ + -moz-box-align: center; } #titlebar-buttonbox-container { @@ -103,28 +110,6 @@ min-height: calc(var(--tab-min-height) + var(--space-above-tabbar) - var(--tab-toolbar-navbar-overlap)); } -/** - * We also vertically center the window buttons. - */ -#titlebar-buttonbox-container { - -moz-box-align: start; -} - -#main-window[tabsintitlebar] > #titlebar > #titlebar-content > #titlebar-buttonbox-container, -#main-window[tabsintitlebar] > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > #titlebar-fullscreen-button { - /* - * To vertically center the window controls, we place them at half the - * height of the tabstrip ((tab height + drag space) / 2) - half the height - * of the window controls (16px / 2). - * */ - margin-top: calc((var(--tab-min-height) + var(--space-above-tabbar)) / 2 - 8px); -} - -#main-window:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-buttonbox-container, -#main-window:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > #titlebar-fullscreen-button { - margin-top: 3px; -} - /** End titlebar **/ #main-window[chromehidden~="toolbar"][chromehidden~="location"][chromehidden~="directories"] { diff --git a/build/build-clang/clang-4-linux64.json b/build/build-clang/clang-4-linux64.json index e358a590b2aa..08799e87962c 100644 --- a/build/build-clang/clang-4-linux64.json +++ b/build/build-clang/clang-4-linux64.json @@ -15,6 +15,7 @@ "cxx": "/builds/worker/workspace/build/src/gcc/bin/g++", "as": "/builds/worker/workspace/build/src/gcc/bin/gcc", "patches": [ - "llvm-debug-frame.patch" + "llvm-debug-frame.patch", + "hide-gcda-profiling-symbols.patch" ] } diff --git a/build/build-clang/hide-gcda-profiling-symbols.patch b/build/build-clang/hide-gcda-profiling-symbols.patch new file mode 100644 index 000000000000..02c9298621b2 --- /dev/null +++ b/build/build-clang/hide-gcda-profiling-symbols.patch @@ -0,0 +1,108 @@ +diff --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c +index 138af6ec4..f0c05075a 100644 +--- a/compiler-rt/lib/profile/GCDAProfiling.c ++++ b/compiler-rt/lib/profile/GCDAProfiling.c +@@ -231,6 +231,7 @@ static void unmap_file() { + * profiling enabled will emit to a different file. Only one file may be + * started at a time. + */ ++COMPILER_RT_VISIBILITY + void llvm_gcda_start_file(const char *orig_filename, const char version[4], + uint32_t checksum) { + const char *mode = "r+b"; +@@ -298,6 +299,7 @@ void llvm_gcda_start_file(const char *orig_filename, const char version[4], + /* Given an array of pointers to counters (counters), increment the n-th one, + * where we're also given a pointer to n (predecessor). + */ ++COMPILER_RT_VISIBILITY + void llvm_gcda_increment_indirect_counter(uint32_t *predecessor, + uint64_t **counters) { + uint64_t *counter; +@@ -320,6 +322,7 @@ void llvm_gcda_increment_indirect_counter(uint32_t *predecessor, + #endif + } + ++COMPILER_RT_VISIBILITY + void llvm_gcda_emit_function(uint32_t ident, const char *function_name, + uint32_t func_checksum, uint8_t use_extra_checksum, + uint32_t cfg_checksum) { +@@ -346,6 +349,7 @@ void llvm_gcda_emit_function(uint32_t ident, const char *function_name, + write_string(function_name); + } + ++COMPILER_RT_VISIBILITY + void llvm_gcda_emit_arcs(uint32_t num_counters, uint64_t *counters) { + uint32_t i; + uint64_t *old_ctrs = NULL; +@@ -397,6 +401,7 @@ void llvm_gcda_emit_arcs(uint32_t num_counters, uint64_t *counters) { + #endif + } + ++COMPILER_RT_VISIBILITY + void llvm_gcda_summary_info() { + const uint32_t obj_summary_len = 9; /* Length for gcov compatibility. */ + uint32_t i; +@@ -450,6 +455,7 @@ void llvm_gcda_summary_info() { + #endif + } + ++COMPILER_RT_VISIBILITY + void llvm_gcda_end_file() { + /* Write out EOF record. */ + if (output_file) { +@@ -474,6 +480,7 @@ void llvm_gcda_end_file() { + #endif + } + ++COMPILER_RT_VISIBILITY + void llvm_register_writeout_function(writeout_fn fn) { + struct writeout_fn_node *new_node = malloc(sizeof(struct writeout_fn_node)); + new_node->fn = fn; +@@ -487,6 +494,7 @@ void llvm_register_writeout_function(writeout_fn fn) { + } + } + ++COMPILER_RT_VISIBILITY + void llvm_writeout_files(void) { + struct writeout_fn_node *curr = writeout_fn_head; + +@@ -496,6 +504,7 @@ void llvm_writeout_files(void) { + } + } + ++COMPILER_RT_VISIBILITY + void llvm_delete_writeout_function_list(void) { + while (writeout_fn_head) { + struct writeout_fn_node *node = writeout_fn_head; +@@ -506,6 +515,7 @@ void llvm_delete_writeout_function_list(void) { + writeout_fn_head = writeout_fn_tail = NULL; + } + ++COMPILER_RT_VISIBILITY + void llvm_register_flush_function(flush_fn fn) { + struct flush_fn_node *new_node = malloc(sizeof(struct flush_fn_node)); + new_node->fn = fn; +@@ -519,6 +529,7 @@ void llvm_register_flush_function(flush_fn fn) { + } + } + ++COMPILER_RT_VISIBILITY + void __gcov_flush() { + struct flush_fn_node *curr = flush_fn_head; + +@@ -528,6 +539,7 @@ void __gcov_flush() { + } + } + ++COMPILER_RT_VISIBILITY + void llvm_delete_flush_function_list(void) { + while (flush_fn_head) { + struct flush_fn_node *node = flush_fn_head; +@@ -538,6 +550,7 @@ void llvm_delete_flush_function_list(void) { + flush_fn_head = flush_fn_tail = NULL; + } + ++COMPILER_RT_VISIBILITY + void llvm_gcov_init(writeout_fn wfn, flush_fn ffn) { + static int atexit_ran = 0; + diff --git a/devtools/client/debugger/new/debugger.css b/devtools/client/debugger/new/debugger.css index ba3f85021632..88322dcdc95f 100644 --- a/devtools/client/debugger/new/debugger.css +++ b/devtools/client/debugger/new/debugger.css @@ -409,6 +409,78 @@ body { :root.theme-dark .CodeMirror-scrollbar-filler { background: transparent; } +.modal-wrapper { + position: fixed; + display: flex; + justify-content: center; + width: 100%; + height: 100%; + top: 0; + left: 0; + transition: z-index 200ms; + z-index: 100; +} + +.modal { + top: 0; + height: 230px; + width: 500px; + background-color: var(--theme-codemirror-gutter-background); + transform: translateY(-250px); + transition: transform 150ms cubic-bezier(0.07, 0.95, 0, 1); + box-shadow: 2px 4px 6px var(--popup-shadow-color); +} + +.modal.entering, +.modal.exited { + transform: translateY(-250px); +} + +.modal.entered, +.modal.exiting { + transform: translateY(30px); +} + +@media (max-width: 520px) { + .modal { + width: 80%; + left: 10%; + } +} +.shortcuts-content { + padding: 15px; +} + +.shortcuts-content h2 { + margin-top: 2px; + margin-bottom: 2px; + color: var(--theme-graphs-bluegrey); +} + +.shortcuts-section { + margin-bottom: 20px; +} + +.shortcuts-list { + list-style: none; + margin: 0px; + padding: 0px; + overflow: auto; + width: calc(100% - 1px); /* 1px fixes the hidden right border */ +} + +.shortcuts-modal { + height: fit-content; +} + +.shortcuts-list li { + width: 40%; + color: var(--theme-body-color); + padding-top: 5px; + display: flex; + justify-content: space-between; + border: 1px solid transparent; +} :root.theme-light, :root .theme-light { --search-overlays-semitransparent: rgba(221, 225, 228, 0.66); @@ -424,6 +496,17 @@ body { box-sizing: border-box; } +button { + background: transparent; + outline: none; + border: none; +} + +button:hover, +button:focus { + background-color: var(--theme-toolbar-background-hover); +} + .debugger { display: flex; flex: 1; @@ -793,6 +876,7 @@ menuseparator { .file, .worker, .refresh, +.shortcut, .add-button { fill: var(--theme-splitter-color); } @@ -816,6 +900,7 @@ menuseparator { .folder svg, .worker svg, .refresh svg, +.shortcut svg, .add-button svg { width: 15px; } @@ -828,6 +913,7 @@ menuseparator { .domain svg, .folder svg, .refresh svg, +.shortcut svg, .worker svg { margin-inline-end: 5px; } @@ -857,6 +943,17 @@ html .arrow.expanded svg { .arrow.hidden { visibility: hidden; } + +.webpack svg { + width: 15px; + height: 15px; + margin-right: 5px; + vertical-align: bottom; +} + +.theme-dark .webpack { + opacity: 0.5; +} .managed-tree .tree { -webkit-user-select: none; -moz-user-select: none; @@ -1301,38 +1398,6 @@ html[dir="rtl"] .managed-tree .tree .node > div { user-select: none; } -.sources-header { - height: 29px; - background-color: var(--theme-toolbar-background); - border-bottom: 1px solid var(--theme-splitter-color); - padding-top: 0px; - padding-bottom: 0px; - line-height: 30px; - font-size: 1.2em; - display: flex; - align-items: baseline; - -moz-user-select: none; - user-select: none; - justify-content: flex-end; -} - -.theme-dark .sources-header { - background-color: var(--theme-tab-toolbar-background); -} - -.sources-header { - padding-inline-start: 10px; -} - -.sources-header-info { - font-size: 12px; - color: var(--theme-comment-alt); - font-weight: lighter; - white-space: nowrap; - padding-inline-end: 10px; - cursor: default; -} - .sources-list { flex: 1; display: flex; @@ -1347,6 +1412,14 @@ html[dir="rtl"] .managed-tree .tree .node > div { overflow-y: auto; } +.sources-list .managed-tree .tree .node { + padding: 0px 0px 0px 3px; +} + +.sources-list .tree .arrow svg { + margin-top: 0px; +} + .theme-dark .sources-list .tree .node:not(.focused) svg { fill: var(--theme-content-color3); } @@ -1355,6 +1428,15 @@ html[dir="rtl"] .managed-tree .tree .node > div { background-color: var(--theme-tab-toolbar-background); } +.sources-list .tree .focused .label { + background-color: var(--theme-selection-background); +} + +.sources-list .tree .label { + padding: 3px 0px 3px 0px; + display: inline-block; +} + .no-sources-message { font-size: 12px; color: var(--theme-comment-alt); @@ -1366,56 +1448,58 @@ html[dir="rtl"] .managed-tree .tree .node > div { align-items: center; } -.sources-panel .source-footer { - position: relative; -} - .sources-panel .outline { display: flex; flex: 1; } -.sources-panel .outline.hidden { - display: none; -} - -.hidden { - display: none; -} - -.source-footer { +.source-outline-tabs { width: 100%; + background: var(--theme-body-background); + border-top: 1px solid var(--theme-splitter-color); + display: flex; + -moz-user-select: none; + user-select: none; + box-sizing: border-box; } -.source-footer .tab { +.source-outline-tabs .tab { flex: 1; justify-content: center; - border: 1px solid transparent; - border-bottom-left-radius: 2px; - border-bottom-right-radius: 2px; + border-bottom: 1px solid transparent; + border-left: 1px solid transparent; display: inline-flex; position: relative; transition: all 0.25s ease; overflow: hidden; - padding: 5px; + padding: 6.5px; margin-bottom: 0px; margin-top: -1px; cursor: default; } -.source-footer .tab:hover { +.source-outline-tabs .tab:first-child { + border-left: 0; +} + +.source-outline-tabs .tab:hover { background-color: var(--theme-toolbar-background-alt); border-color: var(--theme-splitter-color); } -.source-footer .tab.active { +.source-outline-tabs .tab { color: var(--theme-body-color); background-color: var(--theme-toolbar-background); border-color: var(--theme-splitter-color); } -.source-footer .tab.active path, -.source-footer .tab:hover path { +.source-outline-tabs .tab.active { + background-color: var(--theme-body-background); + border-bottom-color: transparent; +} + +.source-outline-tabs .tab.active path, +.source-outline-tabs .tab:hover path { fill: var(--theme-body-color); } .outline { @@ -1504,14 +1588,14 @@ html[dir="rtl"] .managed-tree .tree .node > div { } .toggle-button-start, .toggle-button-end { - transform: translate(0, 2px); + transform: translate(0, 0px); transition: transform 0.25s ease-in-out; - padding: 5px 2px; + padding: 5px 5px; } .toggle-button-start.vertical, .toggle-button-end.vertical { - padding: 4px 2px; + padding: 2.5px 2.5px; } .toggle-button-start svg, @@ -1526,12 +1610,12 @@ html[dir="rtl"] .managed-tree .tree .node > div { } .toggle-button-end { - margin-inline-end: 5px; + margin-inline-end: 0px; margin-inline-start: auto; } .toggle-button-start { - margin-inline-start: 5px; + margin-inline-start: 0px; } html:not([dir="rtl"]) .toggle-button-end svg, @@ -2244,11 +2328,6 @@ html[dir="rtl"] .arrow svg, --theme-conditional-breakpoint-color: var(--theme-body-color); } -.paused .in-scope .CodeMirror-line, -.paused .in-scope .CodeMirror-linenumber { - opacity: 1; -} - .paused .CodeMirror-line, .paused .CodeMirror-linenumber { opacity: 0.7; @@ -2262,7 +2341,7 @@ html[dir="rtl"] .arrow svg, position: absolute; height: calc(100% - 31px); width: calc(100% - 1.5px); - top: 30px; + top: 29px; left: 0px; --editor-footer-height: 24px; } @@ -2457,7 +2536,6 @@ html[dir="rtl"] .editor-mount { } .breakpoints-list * { - -moz-user-select: none; user-select: none; } @@ -2621,8 +2699,8 @@ html .breakpoints-list .breakpoint.paused { position: relative; } -.expression-container .close-btn { - display: none; +.expression-content .tree-node { + overflow-x: hidden; } .expression-container:hover .close-btn { @@ -2679,8 +2757,9 @@ html .breakpoints-list .breakpoint.paused { .why-paused .message.warning { font-size: 10px; - color: var(--theme-graphs-full-red); + color: var(--theme-graphs-red); font-weight: bold; + font-style: normal; } .frames ul { list-style: none; @@ -2819,7 +2898,18 @@ html .breakpoints-list .breakpoint.paused { .event-listeners .listener:hover .close { display: block; } - +.workers-list * { + user-select: none; +} + +.workers-list .worker { + font-size: 12px; + color: var(--theme-content-color1); + padding: 0.5em 1em 0.5em 0.5em; + line-height: 1em; + position: relative; + transition: all 0.25s ease; +} :root { --accordion-header-background: var(--theme-toolbar-background); } @@ -2900,10 +2990,8 @@ html .breakpoints-list .breakpoint.paused { flex: 0 0 29px; border-bottom: 1px solid var(--theme-splitter-color); display: flex; - height: 29px; overflow: hidden; position: sticky; - top: 0; z-index: 1; background-color: var(--theme-toolbar-background); } @@ -2980,6 +3068,17 @@ html .command-bar > button:disabled { .command-bar button.pause-exceptions.all { color: var(--theme-highlight-blue); } + +.bottom { + border-bottom: none; + background-color: var(--theme-body-background); + border-top: 1px solid var(--theme-splitter-color); + flex: 0 0 27px; +} + +.command-bar > button { + padding: 6px 5px; +} .object-node.default-property { opacity: 0.6; } @@ -3062,7 +3161,7 @@ html .command-bar > button:disabled { color: var(--theme-comment-alt); background-color: var(--theme-toolbar-background); font-weight: lighter; - z-index: 100; + z-index: 10; user-select: none; } @@ -3281,45 +3380,6 @@ html[dir="rtl"] .dropdown { left: 0; top: 0; } -.modal-wrapper { - position: fixed; - display: flex; - justify-content: center; - width: 100%; - height: 100%; - top: 0; - left: 0; - transition: z-index 200ms; - z-index: 9; -} - -.modal { - top: 0; - z-index: 10; - width: 500px; - height: 230px; - background-color: var(--theme-codemirror-gutter-background); - transform: translateY(-250px); - transition: transform 150ms cubic-bezier(0.07, 0.95, 0, 1); - box-shadow: 2px 4px 6px var(--popup-shadow-color); -} - -.modal.entering, -.modal.exited { - transform: translateY(-250px); -} - -.modal.entered, -.modal.exiting { - transform: translateY(30px); -} - -@media (max-width: 520px) { - .modal { - width: 80%; - left: 10%; - } -} .symbol-modal-wrapper { position: fixed; width: 100%; diff --git a/devtools/client/debugger/new/debugger.js b/devtools/client/debugger/new/debugger.js index c1213180cb13..9e72b0176faf 100644 --- a/devtools/client/debugger/new/debugger.js +++ b/devtools/client/debugger/new/debugger.js @@ -143,7 +143,8 @@ if ((0, _devtoolsConfig.isFirefoxPanel)()) { (0, _devtoolsLaunchpad.bootstrap)(_react2.default, _reactDom2.default).then(connection => { (0, _client.onConnect)(connection, { - sourceMaps: __webpack_require__(898) + services: { sourceMaps: __webpack_require__(898) }, + toolboxActions: {} }); }); } @@ -506,6 +507,7 @@ Object.defineProperty(exports, "__esModule", { exports.nodeHasChildren = nodeHasChildren; exports.isExactUrlMatch = isExactUrlMatch; exports.isDirectory = isDirectory; +exports.isNotJavaScript = isNotJavaScript; exports.isInvalidUrl = isInvalidUrl; exports.partIsFile = partIsFile; exports.createNode = createNode; @@ -541,8 +543,18 @@ function isDirectory(url) { return parts.length === 0 || url.path.slice(-1) === "/" || nodeHasChildren(url); } +function isNotJavaScript(source) { + var parsedUrl = (0, _url.parse)(source.url).pathname; + if (!parsedUrl) { + return false; + } + var parsedExtension = parsedUrl.split(".").pop(); + + return ["css", "svg", "png"].includes(parsedExtension); +} + function isInvalidUrl(url, source) { - return IGNORED_URLS.indexOf(url) != -1 || !source.get("url") || source.get("loadedState") === "loading" || !url.group || (0, _source.isPretty)(source.toJS()); + return IGNORED_URLS.indexOf(url) != -1 || !source.get("url") || source.get("loadedState") === "loading" || !url.group || (0, _source.isPretty)(source.toJS()) || isNotJavaScript(source.toJS()); } function partIsFile(index, parts, url) { @@ -647,12 +659,10 @@ exports.compose = _compose2["default"]; /***/ (function(module, exports, __webpack_require__) { /** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. + * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ if (false) { @@ -858,6 +868,8 @@ function getFilenameFromPath(pathname) { } function getURL(sourceUrl) { + var debuggeeUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + var url = sourceUrl; var def = { path: "", group: "", filename: "" }; if (!url) { @@ -870,6 +882,7 @@ function getURL(sourceUrl) { host = _parse.host, path = _parse.path; + var defaultDomain = (0, _url.parse)(debuggeeUrl).host; var filename = getFilenameFromPath(pathname); switch (protocol) { @@ -877,6 +890,14 @@ function getURL(sourceUrl) { // Ignore `javascript:` URLs for now return def; + case "webpack:": + // A Webpack source is a special case + return (0, _lodash.merge)(def, { + path: path, + group: "Webpack", + filename: filename + }); + case "about:": // An about page is a special case return (0, _lodash.merge)(def, { @@ -899,7 +920,7 @@ function getURL(sourceUrl) { // with a weird URL. Just group them all under an anonymous group. return (0, _lodash.merge)(def, { path: url, - group: "(no domain)", + group: defaultDomain, filename: filename }); } @@ -2065,6 +2086,12 @@ Object.defineProperty(exports, "getRelativePath", { return _utils.getRelativePath; } }); +Object.defineProperty(exports, "isNotJavaScript", { + enumerable: true, + get: function () { + return _utils.isNotJavaScript; + } +}); /***/ }), /* 40 */ @@ -2168,7 +2195,7 @@ function addSourceToNode(node, url, source) { * @static */ function addToTree(tree, source, debuggeeUrl) { - var url = (0, _getURL.getURL)(source.get("url")); + var url = (0, _getURL.getURL)(source.get("url"), debuggeeUrl); if ((0, _utils.isInvalidUrl)(url, source)) { return; @@ -7218,7 +7245,7 @@ module.exports = { var array = this._array; var maxIndex = array.length - 1; var ii = 0; - return new Iterator(function() + return new Iterator(function() {return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])} @@ -7689,7 +7716,7 @@ module.exports = { Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this; var ii = 0; - return new Iterator(function() + return new Iterator(function() {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()} ); }; @@ -9887,7 +9914,7 @@ module.exports = { return flipSequence; }; } - reversedSequence.get = function(key, notSetValue) + reversedSequence.get = function(key, notSetValue) {return iterable.get(useKeys ? key : -1 - key, notSetValue)}; reversedSequence.has = function(key ) {return iterable.has(useKeys ? key : -1 - key)}; @@ -10086,7 +10113,7 @@ module.exports = { return this.cacheResult().__iterate(fn, reverse); } var iterations = 0; - iterable.__iterate(function(v, k, c) + iterable.__iterate(function(v, k, c) {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)} ); return iterations; @@ -10277,7 +10304,7 @@ module.exports = { interposedSequence.size = iterable.size && iterable.size * 2 -1; interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; var iterations = 0; - iterable.__iterate(function(v, k) + iterable.__iterate(function(v, k) {return (!iterations || fn(separator, iterations++, this$0) !== false) && fn(v, iterations++, this$0) !== false}, reverse @@ -14668,12 +14695,10 @@ module.exports = Sidebar; "use strict"; /** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. + * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ @@ -14718,7 +14743,8 @@ module.exports = function() { objectOf: getShim, oneOf: getShim, oneOfType: getShim, - shape: getShim + shape: getShim, + exact: getShim }; ReactPropTypes.checkPropTypes = emptyFunction; @@ -14737,13 +14763,11 @@ module.exports = function() { /** * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. * + * */ function makeEmptyFunction(arg) { @@ -14904,11 +14928,9 @@ module.exports = Settings; "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. * */ @@ -15282,12 +15304,10 @@ module.exports = function (className) { "use strict"; /** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. + * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ @@ -15548,12 +15568,12 @@ var history = exports.history = function () { var dispatch = _ref.dispatch, getState = _ref.getState; - if ((0, _devtoolsConfig.isDevelopment)()) { - console.warn("Using history middleware stores all actions in state for " + "testing and devtools is not currently running in test " + "mode. Be sure this is intentional."); - } return next => action => { - log.push(action); - next(action); + if ((0, _devtoolsConfig.isDevelopment)()) { + log.push(action); + } + + return next(action); }; }; }; @@ -15938,7 +15958,7 @@ const prefsSchemaVersion = "1.0.3"; const pref = Services.pref; if (isDevelopment()) { - pref("devtools.debugger.client-source-maps-enabled", true); + pref("devtools.source-map.client-service.enabled", true); pref("devtools.debugger.pause-on-exceptions", false); pref("devtools.debugger.ignore-caught-exceptions", false); pref("devtools.debugger.call-stack-visible", false); @@ -15954,13 +15974,14 @@ if (isDevelopment()) { pref("devtools.debugger.file-search-whole-word", false); pref("devtools.debugger.file-search-regex-match", false); pref("devtools.debugger.prefs-schema-version", "1.0.1"); - pref("devtools.debugger.project-text-search-enabled", true); + pref("devtools.debugger.features.project-text-search", true); pref("devtools.debugger.features.async-stepping", true); pref("devtools.debugger.features.wasm", true); + pref("devtools.debugger.features.shortcuts", true); } const prefs = new PrefsHelper("devtools", { - clientSourceMapsEnabled: ["Bool", "debugger.client-source-maps-enabled"], + clientSourceMapsEnabled: ["Bool", "source-map.client-service.enabled"], pauseOnExceptions: ["Bool", "debugger.pause-on-exceptions"], ignoreCaughtExceptions: ["Bool", "debugger.ignore-caught-exceptions"], callStackVisible: ["Bool", "debugger.call-stack-visible"], @@ -15982,8 +16003,9 @@ const prefs = new PrefsHelper("devtools", { const features = new PrefsHelper("devtools.debugger.features", { asyncStepping: ["Bool", "async-stepping", false], - projectTextSearch: ["Bool", "project-text-search-enabled", true], - wasm: ["Bool", "wasm", true] + projectTextSearch: ["Bool", "project-text-search", true], + wasm: ["Bool", "wasm", true], + shortcuts: ["Bool", "shortcuts", false] }); /* harmony export (immutable) */ __webpack_exports__["features"] = features; @@ -16054,6 +16076,14 @@ var _sourceSearch = __webpack_require__(1132); var _sourceSearch2 = _interopRequireDefault(_sourceSearch); +var _sourceTree = __webpack_require__(1176); + +var _sourceTree2 = _interopRequireDefault(_sourceTree); + +var _debuggee = __webpack_require__(1175); + +var _debuggee2 = _interopRequireDefault(_debuggee); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* This Source Code Form is subject to the terms of the Mozilla Public @@ -16072,7 +16102,9 @@ exports.default = { ast: _ast2.default, coverage: _coverage2.default, projectTextSearch: _projectTextSearch2.default, - sourceSearch: _sourceSearch2.default + sourceSearch: _sourceSearch2.default, + sourceTree: _sourceTree2.default, + debuggee: _debuggee2.default }; /***/ }), @@ -16688,7 +16720,7 @@ function shouldPrettyPrint(source) { } var _isPretty = isPretty(source); - var _isJavaScript = isJavaScript(source.url); + var _isJavaScript = isJavaScript(source); var isOriginal = (0, _devtoolsSourceMap.isOriginalId)(source.id); var hasSourceMap = source.sourceMapURL; @@ -16709,10 +16741,8 @@ function shouldPrettyPrint(source) { * @memberof utils/source * @static */ -function isJavaScript(url) { - var contentType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; - - return url && /\.(jsm|js)?$/.test(trimUrlQuery(url)) || contentType.includes("javascript"); +function isJavaScript(source) { + return source.url && /\.(jsm|js)?$/.test(trimUrlQuery(source.url)) || !!(source.contentType && source.contentType.includes("javascript")); } /** @@ -17390,7 +17420,7 @@ exports.default = update; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getSelectedFrame = exports.getLoadedObjects = exports.getPause = exports.State = undefined; +exports.getSelectedFrame = exports.getSelectedFrameId = exports.getLoadedObjects = exports.getPause = exports.State = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* This Source Code Form is subject to the terms of the Mozilla Public @@ -17398,6 +17428,9 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ exports.isStepping = isStepping; +exports.isPaused = isPaused; +exports.isEvaluatingExpression = isEvaluatingExpression; +exports.hasWatchExpressionErrored = hasWatchExpressionErrored; exports.getLoadedObject = getLoadedObject; exports.getObjectProperties = getObjectProperties; exports.getIsWaitingOnBreak = getIsWaitingOnBreak; @@ -17539,6 +17572,11 @@ function update() { case "CLEAR_COMMAND": return _extends({}, state, { command: "" }); + case "EVALUATE_EXPRESSION": + return _extends({}, state, { + command: action.status === "start" ? "expression" : "" + }); + case "NAVIGATE": return _extends({}, state, { debuggeeUrl: action.url }); } @@ -17567,6 +17605,19 @@ function isStepping(state) { return ["stepIn", "stepOver", "stepOut"].includes(state.pause.command); } +function isPaused(state) { + return !!getPause(state); +} + +function isEvaluatingExpression(state) { + return state.pause.command === "expression"; +} + +function hasWatchExpressionErrored(state) { + var pause = getPause(state); + return isEvaluatingExpression(state) && pause && pause.why.type === "exception"; +} + function getLoadedObject(state, objectId) { return getLoadedObjects(state)[objectId]; } @@ -17595,7 +17646,7 @@ function getFrameScopes(state, frameId) { return state.pause.frameScopes[frameId]; } -var getSelectedFrameId = (0, _reselect.createSelector)(getPauseState, pauseWrapper => { +var getSelectedFrameId = exports.getSelectedFrameId = (0, _reselect.createSelector)(getPauseState, pauseWrapper => { return pauseWrapper.selectedFrameId; }); @@ -17904,6 +17955,10 @@ var _pause = __webpack_require__(239); var pause = _interopRequireWildcard(_pause); +var _debuggee = __webpack_require__(1175); + +var debuggee = _interopRequireWildcard(_debuggee); + var _breakpoints = __webpack_require__(236); var breakpoints = _interopRequireWildcard(_breakpoints); @@ -17936,6 +17991,10 @@ var _sourceSearch = __webpack_require__(1132); var sourceSearch = _interopRequireWildcard(_sourceSearch); +var _sourceTree = __webpack_require__(1176); + +var sourceTree = _interopRequireWildcard(_sourceTree); + var _breakpointAtLocation = __webpack_require__(1134); var _breakpointAtLocation2 = _interopRequireDefault(_breakpointAtLocation); @@ -17960,7 +18019,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; * @param object - location */ -module.exports = Object.assign({}, expressions, sources, pause, breakpoints, pendingBreakpoints, eventListeners, ui, ast, coverage, projectTextSearch, sourceSearch, { +module.exports = Object.assign({}, expressions, sources, pause, debuggee, breakpoints, pendingBreakpoints, eventListeners, ui, ast, coverage, projectTextSearch, sourceSearch, sourceTree, { getBreakpointAtLocation: _breakpointAtLocation2.default, getInScopeLines: _linesInScope2.default, getVisibleBreakpoints: _visibleBreakpoints2.default, @@ -17986,10 +18045,14 @@ var _reactRedux = __webpack_require__(151); var _redux = __webpack_require__(3); +var _prefs = __webpack_require__(226); + var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); +var _ShortcutsModal = __webpack_require__(1181); + var _selectors = __webpack_require__(242); var _ui = __webpack_require__(1128); @@ -18047,6 +18110,7 @@ class App extends _react.Component { constructor(props) { super(props); this.state = { + shortcutsModalEnabled: false, horizontal: verticalLayoutBreakpoint.matches, startPanelSize: 0, endPanelSize: 0 @@ -18150,6 +18214,12 @@ class App extends _react.Component { ); } + toggleShortcutsModal() { + this.setState({ + shortcutsModalEnabled: !this.state.shortcutsModalEnabled + }); + } + renderHorizontalLayout() { var _props4 = this.props, startPanelCollapsed = _props4.startPanelCollapsed, @@ -18177,7 +18247,10 @@ class App extends _react.Component { onResizeEnd: size => this.setState({ endPanelSize: size }), endPanelControl: true, startPanel: this.renderEditorPane(), - endPanel: _react2.default.createElement(_SecondaryPanes2.default, { horizontal: horizontal }), + endPanel: _react2.default.createElement(_SecondaryPanes2.default, { + horizontal: horizontal, + toggleShortcutsModal: () => this.toggleShortcutsModal() + }), endPanelCollapsed: endPanelCollapsed, vert: horizontal }) @@ -18230,18 +18303,28 @@ class App extends _react.Component { }); } + renderShortcutsModal() { + if (!_prefs.features.shortcuts) { + return; + } + + return _react2.default.createElement(_ShortcutsModal.ShortcutsModal, { + enabled: this.state.shortcutsModalEnabled, + handleClose: () => this.toggleShortcutsModal() + }); + } + render() { return _react2.default.createElement( "div", { className: "debugger" }, this.state.horizontal ? this.renderHorizontalLayout() : this.renderVerticalLayout(), - this.renderSymbolModal() + this.renderSymbolModal(), + this.renderShortcutsModal() ); } } -App.displayName = "App"; - App.childContextTypes = { shortcuts: _react.PropTypes.object }; exports.default = (0, _reactRedux.connect)(state => ({ @@ -18306,13 +18389,25 @@ var _sourceSearch = __webpack_require__(1144); var sourceSearch = _interopRequireWildcard(_sourceSearch); +var _sourceTree = __webpack_require__(1178); + +var sourceTree = _interopRequireWildcard(_sourceTree); + var _loadSourceText = __webpack_require__(1143); var loadSourceText = _interopRequireWildcard(_loadSourceText); +var _debuggee = __webpack_require__(1179); + +var debuggee = _interopRequireWildcard(_debuggee); + +var _toolbox = __webpack_require__(1180); + +var toolbox = _interopRequireWildcard(_toolbox); + 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; } } -exports.default = Object.assign({}, navigation, breakpoints, expressions, eventListeners, sources, pause, ui, ast, coverage, projectTextSearch, sourceSearch, loadSourceText); +exports.default = Object.assign({}, navigation, breakpoints, expressions, eventListeners, sources, pause, ui, ast, coverage, projectTextSearch, sourceSearch, sourceTree, loadSourceText, debuggee, toolbox); /***/ }), /* 245 */ @@ -18419,13 +18514,17 @@ function syncBreakpoint(sourceId, pendingBreakpoint) { * @param {Boolean} $1.disabled Disable value for breakpoint value */ -function addBreakpoint(location, condition, hidden) { +function addBreakpoint(location) { + var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + condition = _ref4.condition, + hidden = _ref4.hidden; + var breakpoint = (0, _breakpoint.createBreakpoint)(location, { condition, hidden }); - return (_ref4) => { - var dispatch = _ref4.dispatch, - getState = _ref4.getState, - sourceMaps = _ref4.sourceMaps, - client = _ref4.client; + return (_ref5) => { + var dispatch = _ref5.dispatch, + getState = _ref5.getState, + sourceMaps = _ref5.sourceMaps, + client = _ref5.client; var action = { type: "ADD_BREAKPOINT", breakpoint }; var promise = (0, _addBreakpoint2.default)(getState, client, sourceMaps, action); @@ -18441,10 +18540,10 @@ function addBreakpoint(location, condition, hidden) { * @return {function(ThunkArgs)} */ function addHiddenBreakpoint(location) { - return (_ref5) => { - var dispatch = _ref5.dispatch; + return (_ref6) => { + var dispatch = _ref6.dispatch; - return dispatch(addBreakpoint(location, "", true)); + return dispatch(addBreakpoint(location, { hidden: true })); }; } @@ -18455,10 +18554,10 @@ function addHiddenBreakpoint(location) { * @static */ function removeBreakpoint(location) { - return (_ref6) => { - var dispatch = _ref6.dispatch, - getState = _ref6.getState, - client = _ref6.client; + return (_ref7) => { + var dispatch = _ref7.dispatch, + getState = _ref7.getState, + client = _ref7.client; var bp = (0, _selectors.getBreakpoint)(getState(), location); if (!bp || bp.loading) { @@ -18494,11 +18593,11 @@ function removeBreakpoint(location) { */ function enableBreakpoint(location) { return (() => { - var _ref7 = _asyncToGenerator(function* (_ref8) { - var dispatch = _ref8.dispatch, - getState = _ref8.getState, - client = _ref8.client, - sourceMaps = _ref8.sourceMaps; + var _ref8 = _asyncToGenerator(function* (_ref9) { + var dispatch = _ref9.dispatch, + getState = _ref9.getState, + client = _ref9.client, + sourceMaps = _ref9.sourceMaps; var breakpoint = (0, _selectors.getBreakpoint)(getState(), location); if (!breakpoint || breakpoint.loading) { @@ -18514,8 +18613,8 @@ function enableBreakpoint(location) { }); }); - return function (_x2) { - return _ref7.apply(this, arguments); + return function (_x3) { + return _ref8.apply(this, arguments); }; })(); } @@ -18528,10 +18627,10 @@ function enableBreakpoint(location) { */ function disableBreakpoint(location) { return (() => { - var _ref9 = _asyncToGenerator(function* (_ref10) { - var dispatch = _ref10.dispatch, - getState = _ref10.getState, - client = _ref10.client; + var _ref10 = _asyncToGenerator(function* (_ref11) { + var dispatch = _ref11.dispatch, + getState = _ref11.getState, + client = _ref11.client; var bp = (0, _selectors.getBreakpoint)(getState(), location); @@ -18548,8 +18647,8 @@ function disableBreakpoint(location) { }); }); - return function (_x3) { - return _ref9.apply(this, arguments); + return function (_x4) { + return _ref10.apply(this, arguments); }; })(); } @@ -18562,15 +18661,15 @@ function disableBreakpoint(location) { */ function toggleAllBreakpoints(shouldDisableBreakpoints) { return (() => { - var _ref11 = _asyncToGenerator(function* (_ref12) { - var dispatch = _ref12.dispatch, - getState = _ref12.getState; + var _ref12 = _asyncToGenerator(function* (_ref13) { + var dispatch = _ref13.dispatch, + getState = _ref13.getState; var breakpoints = (0, _selectors.getBreakpoints)(getState()); - for (var _ref13 of breakpoints) { - var _ref14 = _slicedToArray(_ref13, 2); + for (var _ref14 of breakpoints) { + var _ref15 = _slicedToArray(_ref14, 2); - var breakpoint = _ref14[1]; + var breakpoint = _ref15[1]; if (shouldDisableBreakpoints) { yield dispatch(disableBreakpoint(breakpoint.location)); @@ -18580,8 +18679,8 @@ function toggleAllBreakpoints(shouldDisableBreakpoints) { } }); - return function (_x4) { - return _ref11.apply(this, arguments); + return function (_x5) { + return _ref12.apply(this, arguments); }; })(); } @@ -18594,13 +18693,13 @@ function toggleAllBreakpoints(shouldDisableBreakpoints) { */ function toggleBreakpoints(shouldDisableBreakpoints, breakpoints) { return (() => { - var _ref15 = _asyncToGenerator(function* (_ref16) { - var dispatch = _ref16.dispatch; + var _ref16 = _asyncToGenerator(function* (_ref17) { + var dispatch = _ref17.dispatch; - for (var _ref17 of breakpoints) { - var _ref18 = _slicedToArray(_ref17, 2); + for (var _ref18 of breakpoints) { + var _ref19 = _slicedToArray(_ref18, 2); - var breakpoint = _ref18[1]; + var breakpoint = _ref19[1]; if (shouldDisableBreakpoints) { yield dispatch(disableBreakpoint(breakpoint.location)); @@ -18610,8 +18709,8 @@ function toggleBreakpoints(shouldDisableBreakpoints, breakpoints) { } }); - return function (_x5) { - return _ref15.apply(this, arguments); + return function (_x6) { + return _ref16.apply(this, arguments); }; })(); } @@ -18624,22 +18723,22 @@ function toggleBreakpoints(shouldDisableBreakpoints, breakpoints) { */ function removeAllBreakpoints() { return (() => { - var _ref19 = _asyncToGenerator(function* (_ref20) { - var dispatch = _ref20.dispatch, - getState = _ref20.getState; + var _ref20 = _asyncToGenerator(function* (_ref21) { + var dispatch = _ref21.dispatch, + getState = _ref21.getState; var breakpoints = (0, _selectors.getBreakpoints)(getState()); - for (var _ref21 of breakpoints) { - var _ref22 = _slicedToArray(_ref21, 2); + for (var _ref22 of breakpoints) { + var _ref23 = _slicedToArray(_ref22, 2); - var breakpoint = _ref22[1]; + var breakpoint = _ref23[1]; yield dispatch(removeBreakpoint(breakpoint.location)); } }); - return function (_x6) { - return _ref19.apply(this, arguments); + return function (_x7) { + return _ref20.apply(this, arguments); }; })(); } @@ -18652,30 +18751,30 @@ function removeAllBreakpoints() { */ function removeBreakpoints(breakpoints) { return (() => { - var _ref23 = _asyncToGenerator(function* (_ref24) { - var dispatch = _ref24.dispatch; + var _ref24 = _asyncToGenerator(function* (_ref25) { + var dispatch = _ref25.dispatch; - for (var _ref25 of breakpoints) { - var _ref26 = _slicedToArray(_ref25, 2); + for (var _ref26 of breakpoints) { + var _ref27 = _slicedToArray(_ref26, 2); - var breakpoint = _ref26[1]; + var breakpoint = _ref27[1]; yield dispatch(removeBreakpoint(breakpoint.location)); } }); - return function (_x7) { - return _ref23.apply(this, arguments); + return function (_x8) { + return _ref24.apply(this, arguments); }; })(); } function remapBreakpoints(sourceId) { return (() => { - var _ref27 = _asyncToGenerator(function* (_ref28) { - var dispatch = _ref28.dispatch, - getState = _ref28.getState, - sourceMaps = _ref28.sourceMaps; + var _ref28 = _asyncToGenerator(function* (_ref29) { + var dispatch = _ref29.dispatch, + getState = _ref29.getState, + sourceMaps = _ref29.sourceMaps; var breakpoints = (0, _selectors.getBreakpoints)(getState()); var newBreakpoints = yield (0, _remapLocations2.default)(breakpoints, sourceId, sourceMaps); @@ -18686,8 +18785,8 @@ function remapBreakpoints(sourceId) { }); }); - return function (_x8) { - return _ref27.apply(this, arguments); + return function (_x9) { + return _ref28.apply(this, arguments); }; })(); } @@ -18705,19 +18804,19 @@ function remapBreakpoints(sourceId) { * @param {Boolean} $1.disabled Disable value for breakpoint value */ function setBreakpointCondition(location) { - var _ref29 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - condition = _ref29.condition; + var _ref30 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + condition = _ref30.condition; return (() => { - var _ref30 = _asyncToGenerator(function* (_ref31) { - var dispatch = _ref31.dispatch, - getState = _ref31.getState, - client = _ref31.client, - sourceMaps = _ref31.sourceMaps; + var _ref31 = _asyncToGenerator(function* (_ref32) { + var dispatch = _ref32.dispatch, + getState = _ref32.getState, + client = _ref32.client, + sourceMaps = _ref32.sourceMaps; var bp = (0, _selectors.getBreakpoint)(getState(), location); if (!bp) { - return dispatch(addBreakpoint(location, condition)); + return dispatch(addBreakpoint(location, { condition })); } if (bp.loading) { @@ -18741,18 +18840,18 @@ function setBreakpointCondition(location) { }); }); - return function (_x10) { - return _ref30.apply(this, arguments); + return function (_x11) { + return _ref31.apply(this, arguments); }; })(); } function toggleBreakpoint(line, column) { - return (_ref32) => { - var dispatch = _ref32.dispatch, - getState = _ref32.getState, - client = _ref32.client, - sourceMaps = _ref32.sourceMaps; + return (_ref33) => { + var dispatch = _ref33.dispatch, + getState = _ref33.getState, + client = _ref33.client, + sourceMaps = _ref33.sourceMaps; var selectedSource = (0, _selectors.getSelectedSource)(getState()); var bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); @@ -18781,11 +18880,11 @@ function toggleBreakpoint(line, column) { } function addOrToggleDisabledBreakpoint(line, column) { - return (_ref33) => { - var dispatch = _ref33.dispatch, - getState = _ref33.getState, - client = _ref33.client, - sourceMaps = _ref33.sourceMaps; + return (_ref34) => { + var dispatch = _ref34.dispatch, + getState = _ref34.getState, + client = _ref34.client, + sourceMaps = _ref34.sourceMaps; var selectedSource = (0, _selectors.getSelectedSource)(getState()); var bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); @@ -18809,11 +18908,11 @@ function addOrToggleDisabledBreakpoint(line, column) { } function toggleDisabledBreakpoint(line, column) { - return (_ref34) => { - var dispatch = _ref34.dispatch, - getState = _ref34.getState, - client = _ref34.client, - sourceMaps = _ref34.sourceMaps; + return (_ref35) => { + var dispatch = _ref35.dispatch, + getState = _ref35.getState, + client = _ref35.client, + sourceMaps = _ref35.sourceMaps; var bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); if (!bp || bp.loading) { @@ -19187,6 +19286,8 @@ var _promise = __webpack_require__(193); var _selectors = __webpack_require__(242); +var _expressions = __webpack_require__(1177); + function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /** @@ -19209,11 +19310,7 @@ function addExpression(input) { var expression = (0, _selectors.getExpression)(getState(), input); if (expression) { - return dispatch({ - type: "UPDATE_EXPRESSION", - expression, - input - }); + return dispatch(evaluateExpression(expression)); } dispatch({ @@ -19221,9 +19318,8 @@ function addExpression(input) { input }); - var selectedFrame = (0, _selectors.getSelectedFrame)(getState()); - var selectedFrameId = selectedFrame ? selectedFrame.id : null; - dispatch(evaluateExpression({ input }, selectedFrameId)); + var newExpression = (0, _selectors.getExpression)(getState(), input); + dispatch(evaluateExpression(newExpression)); }); return function (_x) { @@ -19247,9 +19343,7 @@ function updateExpression(input, expression) { input: input }); - var selectedFrame = (0, _selectors.getSelectedFrame)(getState()); - var selectedFrameId = selectedFrame ? selectedFrame.id : null; - dispatch(evaluateExpressions(selectedFrameId)); + dispatch(evaluateExpressions()); }; } @@ -19277,7 +19371,7 @@ function deleteExpression(expression) { * @param {number} selectedFrameId * @static */ -function evaluateExpressions(frameId) { +function evaluateExpressions() { return (() => { var _ref5 = _asyncToGenerator(function* (_ref6) { var dispatch = _ref6.dispatch, @@ -19285,12 +19379,8 @@ function evaluateExpressions(frameId) { client = _ref6.client; var expressions = (0, _selectors.getExpressions)(getState()).toJS(); - if (!frameId) { - var selectedFrame = (0, _selectors.getSelectedFrame)(getState()); - frameId = selectedFrame ? selectedFrame.id : null; - } for (var expression of expressions) { - yield dispatch(evaluateExpression(expression, frameId)); + yield dispatch(evaluateExpression(expression)); } }); @@ -19300,7 +19390,7 @@ function evaluateExpressions(frameId) { })(); } -function evaluateExpression(expression, frameId) { +function evaluateExpression(expression) { return function (_ref7) { var dispatch = _ref7.dispatch, getState = _ref7.getState, @@ -19311,7 +19401,8 @@ function evaluateExpression(expression, frameId) { return; } - const input = wrapExpression(expression.input); + var frameId = (0, _selectors.getSelectedFrameId)(getState()); + var input = (0, _expressions.wrapExpression)(expression.input); return dispatch({ type: "EVALUATE_EXPRESSION", input: expression.input, @@ -19320,22 +19411,6 @@ function evaluateExpression(expression, frameId) { }; } -function sanitizeInput(input) { - return input.replace(/\\/g, "\\\\").replace(/"/g, "\\$&"); -} - -function wrapExpression(input) { - return `eval(\` - try { - ${sanitizeInput(input)} - } catch (e) { - e.name + ": " + e.message - } - \`)`.trim(); -} - - - /***/ }), /* 253 */ /***/ (function(module, exports, __webpack_require__) { @@ -19527,7 +19602,7 @@ function formatListeners(state, listeners) { function updateEventBreakpoints(eventNames) { return dispatch => { setNamedTimeout("event-breakpoints-update", 0, () => { - gThreadClient.pauseOnDOMEvents(eventNames, function () { + gThreadClient.pauseOnDOMEvents(eventNames, () => { // Notify that event breakpoints were added/removed on the server. window.emit(EVENTS.EVENT_BREAKPOINTS_UPDATED); @@ -19615,7 +19690,6 @@ var checkPendingBreakpoints = (() => { exports.newSource = newSource; exports.newSources = newSources; exports.selectSourceURL = selectSourceURL; -exports.openLink = openLink; exports.selectSource = selectSource; exports.jumpToMappedLocation = jumpToMappedLocation; exports.addTab = addTab; @@ -19625,6 +19699,7 @@ exports.closeTabs = closeTabs; exports.togglePrettyPrint = togglePrettyPrint; exports.toggleBlackBox = toggleBlackBox; exports.loadAllSources = loadAllSources; +exports.ensureParserHasSourceText = ensureParserHasSourceText; var _promise = __webpack_require__(193); @@ -19652,8 +19727,14 @@ var _editor = __webpack_require__(257); var _sourceMaps = __webpack_require__(797); +var _parser = __webpack_require__(827); + +var parser = _interopRequireWildcard(_parser); + var _selectors = __webpack_require__(242); +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 _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } @@ -19758,12 +19839,6 @@ function loadSourceMap(generatedSource) { })(); } -function openLink(url) { - return async function({ openLink }) { - openLink(url); - }; -} - /** * Deterministically select a source that has a given URL. This will * work regardless of the connection status or if the source exists @@ -19959,7 +20034,7 @@ function togglePrettyPrint(sourceId) { var source = (0, _selectors.getSource)(getState(), sourceId).toJS(); - if (source && !(0, _source2.isLoaded)(source)) { + if (!source || !(0, _source2.isLoaded)(source)) { return {}; } @@ -20019,7 +20094,7 @@ function toggleBlackBox(source) { } /** - Load the text for all the avaliable sources + Load the text for all the available sources * @memberof actions/sources * @static */ @@ -20056,6 +20131,30 @@ function loadAllSources() { })(); } +/** + * Ensures parser has source text + * + * @memberof actions/sources + * @static + */ +function ensureParserHasSourceText(sourceId) { + return (() => { + var _ref27 = _asyncToGenerator(function* (_ref28) { + var dispatch = _ref28.dispatch, + getState = _ref28.getState; + + if (!(yield parser.hasSource(sourceId))) { + yield dispatch((0, _loadSourceText.loadSourceText)((0, _selectors.getSource)(getState(), sourceId).toJS())); + yield parser.setSource((0, _selectors.getSource)(getState(), sourceId).toJS()); + } + }); + + return function (_x21) { + return _ref27.apply(this, arguments); + }; + })(); +} + /***/ }), /* 255 */ /***/ (function(module, exports, __webpack_require__) { @@ -20280,6 +20379,21 @@ function lineAtHeight(editor, sourceId, event) { return toSourceLine(sourceId, editorLine); } +function getSourceLocationFromMouseEvent(editor, selectedLocation, e) { + var _editor$codeMirror$co = editor.codeMirror.coordsChar({ + left: e.clientX, + top: e.clientY + }), + line = _editor$codeMirror$co.line, + ch = _editor$codeMirror$co.ch; + + return { + sourceId: selectedLocation.sourceId, + line: line + 1, + column: ch + 1 + }; +} + module.exports = Object.assign({}, expressionUtils, sourceDocumentUtils, sourceSearchUtils, _devtoolsSourceEditor.SourceEditorUtils, { createEditor, isWasm: _wasm.isWasm, @@ -20292,7 +20406,8 @@ module.exports = Object.assign({}, expressionUtils, sourceDocumentUtils, sourceS shouldShowFooter, traverseResults, markText, - lineAtHeight + lineAtHeight, + getSourceLocationFromMouseEvent }); /***/ }), @@ -20949,8 +21064,6 @@ ToggleSearch.propTypes = { toggle: _react.PropTypes.func.isRequired }; -ToggleSearch.displayName = "ToggleSearch"; - /***/ }), /* 285 */, /* 286 */, @@ -21313,9 +21426,7 @@ class DebugLine extends _react.Component { return null; } } - exports.default = DebugLine; -DebugLine.displayName = "DebugLine"; /***/ }), /* 314 */, @@ -21387,13 +21498,17 @@ function resumed() { client = _ref.client, getState = _ref.getState; + if (!(0, _selectors.isPaused)(getState())) { + return; + } + dispatch({ type: "RESUME", value: undefined }); if (!(0, _selectors.isStepping)(getState())) { - dispatch((0, _expressions.evaluateExpressions)(null)); + dispatch((0, _expressions.evaluateExpressions)()); } }; } @@ -21413,6 +21528,7 @@ function continueToHere(line) { column: undefined, sourceId: source.id })); + dispatch(command("resume")); }); @@ -21460,7 +21576,11 @@ function paused(pauseInfo) { dispatch((0, _breakpoints.removeBreakpoint)(hiddenBreakpointLocation)); } - dispatch((0, _expressions.evaluateExpressions)(frame.id)); + // NOTE: We don't want to re-evaluate watch expressions + // if we're paused due to an excpression exception #3597 + if (!(0, _selectors.hasWatchExpressionErrored)(getState())) { + dispatch((0, _expressions.evaluateExpressions)()); + } dispatch((0, _sources.selectSource)(frame.location.sourceId, { line: frame.location.line })); }); @@ -21617,16 +21737,13 @@ function selectFrame(frame) { var dispatch = _ref15.dispatch, client = _ref15.client; - dispatch((0, _expressions.evaluateExpressions)(frame.id)); - dispatch((0, _sources.selectSource)(frame.location.sourceId, { line: frame.location.line })); - var scopes = yield client.getFrameScopes(frame); - dispatch({ - type: "SELECT_FRAME", - frame, - scopes - }); + dispatch({ type: "SELECT_FRAME", frame, scopes }); + + dispatch((0, _sources.selectSource)(frame.location.sourceId, { line: frame.location.line })); + + dispatch((0, _expressions.evaluateExpressions)()); }); return function (_x4) { @@ -21749,6 +21866,7 @@ function willNavigate(_, event) { (0, _editor.clearDocuments)(); (0, _parser.clearSymbols)(); (0, _parser.clearASTs)(); + (0, _parser.clearScopes)(); (0, _parser.clearSources)(); dispatch(navigate(event.url)); @@ -21953,7 +22071,7 @@ function clearHighlightLineRange() { function toggleConditionalBreakpointPanel(line) { return { type: "TOGGLE_CONDITIONAL_BREAKPOINT_PANEL", - line + line: line }; } @@ -22052,7 +22170,10 @@ class Modal extends _react.Component { { className: "modal-wrapper", onClick: this.props.handleClose }, _react2.default.createElement( "div", - { className: (0, _classnames2.default)("modal", status), onClick: this.onClick }, + { + className: (0, _classnames2.default)("modal", this.props.additionalClass, status), + onClick: this.onClick + }, this.props.children ) ); @@ -22060,7 +22181,6 @@ class Modal extends _react.Component { } exports.Modal = Modal; -Modal.displayName = "Modal"; Modal.contextTypes = { shortcuts: _react.PropTypes.object }; @@ -22068,6 +22188,7 @@ Modal.contextTypes = { function Slide(_ref) { var inProp = _ref.in, children = _ref.children, + additionalClass = _ref.additionalClass, handleClose = _ref.handleClose; return _react2.default.createElement( @@ -22075,14 +22196,16 @@ function Slide(_ref) { { "in": inProp, timeout: 175, appear: true }, status => _react2.default.createElement( Modal, - { status: status, handleClose: handleClose }, + { + status: status, + additionalClass: additionalClass, + handleClose: handleClose + }, children ) ); } -Slide.displayName = "Slide"; - /***/ }), /* 333 */ /***/ (function(module, exports, __webpack_require__) { @@ -23617,7 +23740,6 @@ exports.default = Autocomplete; Autocomplete.defaultProps = { size: "" }; -Autocomplete.displayName = "Autocomplete"; /***/ }), /* 343 */ @@ -23784,7 +23906,8 @@ var svg = { pug: __webpack_require__(1004), extjs: __webpack_require__(1043), showSources: __webpack_require__(1044), - showOutline: __webpack_require__(1045) + showOutline: __webpack_require__(1045), + shortcut: __webpack_require__(1183) }; function Svg(_ref) { @@ -23807,12 +23930,14 @@ function Svg(_ref) { if (name === "subSettings") { className = ""; } + var props = { className, onClick, ["aria-label"]: ariaLabel, src: svg[name] }; + return React.createElement(InlineSVG, props); } @@ -24192,8 +24317,6 @@ var arrowBtn = (onClick, type, className, tooltip) => { ); }; -arrowBtn.displayName = "ArrowButton"; - class SearchInput extends _react.Component { componentDidMount() { @@ -24337,13 +24460,6 @@ function CloseButton(_ref) { _react2.default.createElement(_Svg2.default, { name: "close" }) ); } - - -CloseButton.displayName = "CloseButton"; -CloseButton.propTypes = { - handleClick: _react.PropTypes.func.isRequired -}; - exports.default = CloseButton; /***/ }), @@ -24536,11 +24652,11 @@ var Tree = (0, _react.createFactory)(_devtoolsComponents.Tree); class ManagedTree extends _react.Component { - constructor() { + constructor(props) { super(); this.state = { - expanded: new Set(), + expanded: props.expanded || new Set(), focusedItem: null }; @@ -24576,9 +24692,9 @@ class ManagedTree extends _react.Component { this.setState({ expanded }); if (isExpanded && this.props.onExpand) { - this.props.onExpand(item); - } else if (!expanded && this.props.onCollapse) { - this.props.onCollapse(item); + this.props.onExpand(item, expanded); + } else if (!isExpanded && this.props.onCollapse) { + this.props.onCollapse(item, expanded); } } @@ -24650,8 +24766,6 @@ class ManagedTree extends _react.Component { } } -ManagedTree.displayName = "ManagedTree"; - ManagedTree.propTypes = Object.assign({}, Tree.propTypes); exports.default = ManagedTree; @@ -24822,40 +24936,20 @@ class Editor extends _react.PureComponent { } componentWillReceiveProps(nextProps) { - // This lifecycle method is responsible for updating the editor - // text. - var selectedSource = nextProps.selectedSource; - - - if (nextProps.startPanelSize !== this.props.startPanelSize || nextProps.endPanelSize !== this.props.endPanelSize) { - this.state.editor.codeMirror.setSize(); + if (!this.state.editor) { + return; } - if (!selectedSource) { - if (this.props.selectedSource) { - this.showMessage(""); - } - } else if (!(0, _source.isLoaded)(selectedSource.toJS())) { - this.showMessage(L10N.getStr("loadingText")); - } else if (selectedSource.get("error")) { - this.showMessage(selectedSource.get("error")); - } else if (this.props.selectedSource !== selectedSource) { - (0, _editor.showSourceText)(this.state.editor, selectedSource.toJS()); - } - - if (this.state.editor && this.props.linesInScope !== nextProps.linesInScope) { - this.state.editor.codeMirror.operation(() => { - (0, _editor.clearLineClass)(this.state.editor.codeMirror, "in-scope"); - }); - - (0, _editor.resizeBreakpointGutter)(this.state.editor.codeMirror); - } + this.setSize(nextProps); + this.setText(nextProps); + (0, _editor.resizeBreakpointGutter)(this.state.editor.codeMirror); } setupEditor() { var editor = (0, _editor.createEditor)(); // disables the default search shortcuts + editor._initShortcuts = () => {}; var node = _reactDom2.default.findDOMNode(this); @@ -24875,6 +24969,7 @@ class Editor extends _react.PureComponent { // Set code editor wrapper to be focusable codeMirrorWrapper.tabIndex = 0; codeMirrorWrapper.addEventListener("keydown", e => this.onKeyDown(e)); + codeMirrorWrapper.addEventListener("click", e => this.onClick(e)); var toggleFoldMarkerVisibility = e => { if (node instanceof HTMLElement) { @@ -24891,9 +24986,9 @@ class Editor extends _react.PureComponent { if (!(0, _devtoolsConfig.isFirefox)()) { codeMirror.on("gutterContextMenu", (cm, line, eventName, event) => this.onGutterContextMenu(event)); - codeMirror.on("contextmenu", (cm, event) => this.openMenu(event, cm)); + codeMirror.on("contextmenu", (cm, event) => this.openMenu(event, editor)); } else { - codeMirrorWrapper.addEventListener("contextmenu", event => this.openMenu(event, codeMirror)); + codeMirrorWrapper.addEventListener("contextmenu", event => this.openMenu(event, editor)); } this.setState({ editor }); @@ -24913,8 +25008,8 @@ class Editor extends _react.PureComponent { var searchAgainKey = L10N.getStr("sourceSearch.search.again.key2"); var searchAgainPrevKey = L10N.getStr("sourceSearch.search.againPrev.key2"); - shortcuts.on("CmdOrCtrl+B", this.onToggleBreakpoint); - shortcuts.on("CmdOrCtrl+Shift+B", this.onToggleBreakpoint); + shortcuts.on(L10N.getStr("toggleBreakpoint.key"), this.onToggleBreakpoint); + shortcuts.on(L10N.getStr("toggleCondPanel.key"), this.onToggleBreakpoint); shortcuts.on("Esc", this.onEscape); shortcuts.on(searchAgainPrevKey, this.onSearchAgain); shortcuts.on(searchAgainKey, this.onSearchAgain); @@ -24934,8 +25029,8 @@ class Editor extends _react.PureComponent { var searchAgainKey = L10N.getStr("sourceSearch.search.again.key2"); var searchAgainPrevKey = L10N.getStr("sourceSearch.search.againPrev.key2"); var shortcuts = this.context.shortcuts; - shortcuts.off("CmdOrCtrl+B"); - shortcuts.off("CmdOrCtrl+Shift+B"); + shortcuts.off(L10N.getStr("toggleBreakpoint.key")); + shortcuts.off(L10N.getStr("toggleCondPanel.key")); shortcuts.off(searchAgainPrevKey); shortcuts.off(searchAgainKey); } @@ -25051,7 +25146,7 @@ class Editor extends _react.PureComponent { return selectedFrame && selectedLocation && selectedFrame.location.sourceId == selectedLocation.sourceId; } - openMenu(event, codeMirror) { + openMenu(event, editor) { var _props5 = this.props, selectedSource = _props5.selectedSource, selectedLocation = _props5.selectedLocation, @@ -25063,7 +25158,7 @@ class Editor extends _react.PureComponent { return (0, _EditorMenu2.default)({ - codeMirror, + editor, event, selectedLocation, selectedSource, @@ -25081,7 +25176,8 @@ class Editor extends _react.PureComponent { selectedSource = _props6.selectedSource, toggleBreakpoint = _props6.toggleBreakpoint, addOrToggleDisabledBreakpoint = _props6.addOrToggleDisabledBreakpoint, - isEmptyLine = _props6.isEmptyLine; + isEmptyLine = _props6.isEmptyLine, + continueToHere = _props6.continueToHere; // ignore right clicks in the gutter @@ -25102,7 +25198,9 @@ class Editor extends _react.PureComponent { } if (gutter !== "CodeMirror-foldgutter") { - if (ev.shiftKey) { + if (ev.altKey) { + continueToHere((0, _editor.toSourceLine)(selectedSource.get("id"), line)); + } else if (ev.shiftKey) { addOrToggleDisabledBreakpoint((0, _editor.toSourceLine)(selectedSource.get("id"), line)); } else { toggleBreakpoint((0, _editor.toSourceLine)(selectedSource.get("id"), line)); @@ -25149,15 +25247,27 @@ class Editor extends _react.PureComponent { }); } + onClick(e) { + var _props8 = this.props, + selectedLocation = _props8.selectedLocation, + jumpToMappedLocation = _props8.jumpToMappedLocation; + + + if (e.metaKey && e.altKey) { + var sourceLocation = (0, _editor.getSourceLocationFromMouseEvent)(this.state.editor, selectedLocation, e); + jumpToMappedLocation(sourceLocation); + } + } + toggleConditionalPanel(line) { if (this.isCbPanelOpen()) { return this.closeConditionalPanel(); } - var _props8 = this.props, - selectedLocation = _props8.selectedLocation, - setBreakpointCondition = _props8.setBreakpointCondition, - breakpoints = _props8.breakpoints; + var _props9 = this.props, + selectedLocation = _props9.selectedLocation, + setBreakpointCondition = _props9.setBreakpointCondition, + breakpoints = _props9.breakpoints; var sourceId = selectedLocation ? selectedLocation.sourceId : ""; @@ -25223,7 +25333,47 @@ class Editor extends _react.PureComponent { this.pendingJumpLocation = null; } + setSize(nextProps) { + if (!this.state.editor) { + return; + } + + if (nextProps.startPanelSize !== this.props.startPanelSize || nextProps.endPanelSize !== this.props.endPanelSize) { + this.state.editor.codeMirror.setSize(); + } + } + + setText(nextProps) { + if (!this.state.editor) { + return; + } + + if (!nextProps.selectedSource) { + if (this.props.selectedSource) { + return this.showMessage(""); + } + + return; + } + + if (!(0, _source.isLoaded)(nextProps.selectedSource.toJS())) { + return this.showMessage(L10N.getStr("loadingText")); + } + + if (nextProps.selectedSource.get("error")) { + return this.showMessage(nextProps.selectedSource.get("error")); + } + + if (nextProps.selectedSource !== this.props.selectedSource) { + return (0, _editor.showSourceText)(this.state.editor, nextProps.selectedSource.toJS()); + } + } + showMessage(msg) { + if (!this.state.editor) { + return; + } + this.state.editor.replaceDocument(this.state.editor.createDocument()); this.state.editor.setText(msg); this.state.editor.setMode({ name: "text" }); @@ -25231,10 +25381,10 @@ class Editor extends _react.PureComponent { } getInlineEditorStyles() { - var _props9 = this.props, - selectedSource = _props9.selectedSource, - horizontal = _props9.horizontal, - searchOn = _props9.searchOn; + var _props10 = this.props, + selectedSource = _props10.selectedSource, + horizontal = _props10.horizontal, + searchOn = _props10.searchOn; var subtractions = []; @@ -25268,9 +25418,9 @@ class Editor extends _react.PureComponent { } renderHitCounts() { - var _props10 = this.props, - hitCount = _props10.hitCount, - selectedSource = _props10.selectedSource; + var _props11 = this.props, + hitCount = _props11.hitCount, + selectedSource = _props11.selectedSource; if (!selectedSource || !(0, _source.isLoaded)(selectedSource.toJS()) || !hitCount || !this.state.editor) { @@ -25294,20 +25444,6 @@ class Editor extends _react.PureComponent { return _react2.default.createElement(_Preview2.default, { editor: this.state.editor }); } - renderInScopeLines() { - var linesInScope = this.props.linesInScope; - - if (!this.state.editor || !(0, _devtoolsConfig.isEnabled)("highlightScopeLines") || !linesInScope || !this.inSelectedFrameSource()) { - return; - } - - this.state.editor.codeMirror.operation(() => { - linesInScope.forEach(line => { - this.state.editor.codeMirror.addLineClass(line - 1, "line", "in-scope"); - }); - }); - } - renderCallSites() { var editor = this.state.editor; @@ -25318,11 +25454,11 @@ class Editor extends _react.PureComponent { } renderSearchBar() { - var _props11 = this.props, - selectSource = _props11.selectSource, - selectedSource = _props11.selectedSource, - highlightLineRange = _props11.highlightLineRange, - clearHighlightLineRange = _props11.clearHighlightLineRange; + var _props12 = this.props, + selectSource = _props12.selectSource, + selectedSource = _props12.selectedSource, + highlightLineRange = _props12.highlightLineRange, + clearHighlightLineRange = _props12.clearHighlightLineRange; if (!this.state.editor) { @@ -25366,9 +25502,9 @@ class Editor extends _react.PureComponent { renderDebugLine() { var editor = this.state.editor; - var _props12 = this.props, - selectedLocation = _props12.selectedLocation, - selectedFrame = _props12.selectedFrame; + var _props13 = this.props, + selectedLocation = _props13.selectedLocation, + selectedFrame = _props13.selectedFrame; if (!editor || !selectedLocation || !selectedFrame || !selectedLocation.line || selectedFrame.location.sourceId !== selectedLocation.sourceId) { return null; @@ -25382,9 +25518,9 @@ class Editor extends _react.PureComponent { } render() { - var _props13 = this.props, - coverageOn = _props13.coverageOn, - pauseData = _props13.pauseData; + var _props14 = this.props, + coverageOn = _props14.coverageOn, + pauseData = _props14.pauseData; return _react2.default.createElement( @@ -25401,7 +25537,6 @@ class Editor extends _react.PureComponent { style: this.getInlineEditorStyles() }), this.renderHighlightLines(), - this.renderInScopeLines(), this.renderHitCounts(), this.renderFooter(), this.renderPreview(), @@ -25413,8 +25548,6 @@ class Editor extends _react.PureComponent { } } -Editor.displayName = "Editor"; - Editor.propTypes = { breakpoints: _reactImmutableProptypes2.default.map, hitCount: _react.PropTypes.object, @@ -25572,12 +25705,12 @@ class SourceFooter extends _react.PureComponent { var sourceLoaded = selectedSource && (0, _source.isLoaded)(selectedSource.toJS()); - var blackboxed = selectedSource.get("isBlackBoxed"); - - if (!(0, _devtoolsConfig.isEnabled)("blackbox")) { + if (!(0, _devtoolsConfig.isEnabled)("blackbox") || !sourceLoaded) { return; } + var blackboxed = selectedSource.get("isBlackBoxed"); + var tooltip = L10N.getStr("sourceFooter.blackbox"); var type = "black-box"; @@ -25600,9 +25733,8 @@ class SourceFooter extends _react.PureComponent { blackBoxSummary() { var selectedSource = this.props.selectedSource; - var blackboxed = selectedSource.get("isBlackBoxed"); - if (!blackboxed) { + if (!selectedSource || !selectedSource.get("isBlackBoxed")) { return; } @@ -25647,12 +25779,6 @@ class SourceFooter extends _react.PureComponent { } renderCommands() { - var selectedSource = this.props.selectedSource; - - if (!(0, _editor.shouldShowPrettyPrint)(selectedSource)) { - return null; - } - return _react2.default.createElement( "div", { className: "commands" }, @@ -25682,8 +25808,6 @@ class SourceFooter extends _react.PureComponent { } } -SourceFooter.displayName = "SourceFooter"; - exports.default = (0, _reactRedux.connect)(state => { var selectedSource = (0, _selectors.getSelectedSource)(state); var selectedId = selectedSource && selectedSource.get("id"); @@ -25742,7 +25866,7 @@ class PaneToggleButton extends _react.Component { var title = !collapsed ? L10N.getStr("expandPanes") : L10N.getStr("collapsePanes"); return _react2.default.createElement( - "div", + "button", { className: (0, _classnames2.default)(`toggle-button-${position}`, { collapsed, @@ -25756,8 +25880,6 @@ class PaneToggleButton extends _react.Component { } } -PaneToggleButton.displayName = "PaneToggleButton"; - exports.default = PaneToggleButton; /***/ }), @@ -26213,7 +26335,6 @@ class SearchBar extends _react.Component { } } -SearchBar.displayName = "SearchBar"; SearchBar.contextTypes = { shortcuts: _react.PropTypes.object }; @@ -26810,10 +26931,12 @@ var _devtoolsSourceMap = __webpack_require__(898); var _clipboard = __webpack_require__(423); +var _editor = __webpack_require__(257); + function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } function getMenuItems(event, _ref) { - var codeMirror = _ref.codeMirror, + var editor = _ref.editor, selectedLocation = _ref.selectedLocation, selectedSource = _ref.selectedSource, showSource = _ref.showSource, @@ -26844,7 +26967,7 @@ function getMenuItems(event, _ref) { click: () => (0, _clipboard.copyToTheClipboard)(selectedSource.get("url")) }; - var selectionText = codeMirror.getSelection().trim(); + var selectionText = editor.codeMirror.getSelection().trim(); var copySource = { id: "node-menu-copy-source", label: copySourceLabel, @@ -26853,18 +26976,12 @@ function getMenuItems(event, _ref) { click: () => (0, _clipboard.copyToTheClipboard)(selectionText) }; - var _codeMirror$coordsCha = codeMirror.coordsChar({ - left: event.clientX, - top: event.clientY + var _editor$codeMirror$co = editor.codeMirror.coordsChar({ + left: event.clientX }), - line = _codeMirror$coordsCha.line, - ch = _codeMirror$coordsCha.ch; + line = _editor$codeMirror$co.line; - var sourceLocation = { - sourceId: selectedLocation.sourceId, - line: line + 1, - column: ch + 1 - }; + var sourceLocation = (0, _editor.getSourceLocationFromMouseEvent)(editor, selectedLocation, event); var pairedType = (0, _devtoolsSourceMap.isOriginalId)(selectedLocation.sourceId) ? L10N.getStr("generated") : L10N.getStr("original"); @@ -26878,7 +26995,7 @@ function getMenuItems(event, _ref) { var watchExpressionLabel = { accesskey: "E", label: L10N.getStr("expressions.placeholder"), - click: () => addExpression(codeMirror.getSelection()) + click: () => addExpression(editor.codeMirror.getSelection()) }; var blackBoxMenuItem = { @@ -26890,7 +27007,7 @@ function getMenuItems(event, _ref) { }; // TODO: Find a new way to only add this for mapped sources? - var textSelected = codeMirror.somethingSelected(); + var textSelected = editor.codeMirror.somethingSelected(); var showSourceMenuItem = { id: "node-menu-show-source", @@ -26909,7 +27026,7 @@ function getMenuItems(event, _ref) { click: () => (0, _clipboard.copyToTheClipboard)(functionText) }; - var menuItems = [copySourceUrl, jumpLabel, showSourceMenuItem, blackBoxMenuItem, copySource, copyFunction]; + var menuItems = [copySource, copySourceUrl, copyFunction, { type: "separator" }, jumpLabel, showSourceMenuItem, blackBoxMenuItem]; if (textSelected) { menuItems.push(watchExpressionLabel); @@ -27176,8 +27293,6 @@ Popover.defaultProps = { type: "popover" }; -Popover.displayName = "Popover"; - exports.default = Popover; /***/ }), @@ -27418,8 +27533,6 @@ class Breakpoint extends _react.Component { } } -Breakpoint.displayName = "Breakpoint"; - exports.default = Breakpoint; /***/ }), @@ -27480,8 +27593,6 @@ class HitMarker extends _react.Component { } } -HitMarker.displayName = "HitMarker"; - exports.default = HitMarker; /***/ }), @@ -27505,6 +27616,8 @@ var _reactRedux = __webpack_require__(151); var _redux = __webpack_require__(3); +var _prefs = __webpack_require__(226); + var _reactImmutableProptypes = __webpack_require__(150); var _reactImmutableProptypes2 = _interopRequireDefault(_reactImmutableProptypes); @@ -27521,8 +27634,6 @@ var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); -var _prefs = __webpack_require__(226); - var _Breakpoints = __webpack_require__(725); var _Breakpoints2 = _interopRequireDefault(_Breakpoints); @@ -27555,6 +27666,10 @@ var _CommandBar = __webpack_require__(742); var _CommandBar2 = _interopRequireDefault(_CommandBar); +var _UtilsBar = __webpack_require__(1185); + +var _UtilsBar2 = _interopRequireDefault(_UtilsBar); + var _ChromeScopes = __webpack_require__(728); var _ChromeScopes2 = _interopRequireDefault(_ChromeScopes); @@ -27583,7 +27698,6 @@ function debugBtn(onClick, type, className, tooltip) { _react2.default.createElement(_Svg2.default, { name: type, title: tooltip, "aria-label": tooltip }) ); } -debugBtn.displayName = "DebugButton"; class SecondaryPanes extends _react.Component { renderBreakpointsToggle() { @@ -27726,12 +27840,24 @@ class SecondaryPanes extends _react.Component { }); } + renderUtilsBar() { + if (!_prefs.features.shortcuts) { + return; + } + + return _react2.default.createElement(_UtilsBar2.default, { + horizontal: this.props.horizontal, + toggleShortcutsModal: this.props.toggleShortcutsModal + }); + } + render() { return _react2.default.createElement( "div", { className: "secondary-panes secondary-panes--sticky-commandbar" }, _react2.default.createElement(_CommandBar2.default, { horizontal: this.props.horizontal }), - this.props.horizontal ? this.renderHorizontalLayout() : this.renderVerticalLayout() + this.props.horizontal ? this.renderHorizontalLayout() : this.renderVerticalLayout(), + this.renderUtilsBar() ); } } @@ -27743,15 +27869,14 @@ SecondaryPanes.propTypes = { breakpoints: _reactImmutableProptypes2.default.map.isRequired, breakpointsDisabled: _react.PropTypes.bool, breakpointsLoading: _react.PropTypes.bool, - toggleAllBreakpoints: _react.PropTypes.func.isRequired + toggleAllBreakpoints: _react.PropTypes.func.isRequired, + toggleShortcutsModal: _react.PropTypes.func }; SecondaryPanes.contextTypes = { shortcuts: _react.PropTypes.object }; -SecondaryPanes.displayName = "SecondaryPanes"; - exports.default = (0, _reactRedux.connect)(state => ({ pauseData: (0, _selectors.getPause)(state), breakpoints: (0, _selectors.getBreakpoints)(state), @@ -27784,6 +27909,8 @@ var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(242); +var _expressions = __webpack_require__(1177); + var _Close = __webpack_require__(378); var _Close2 = _interopRequireDefault(_Close); @@ -27794,42 +27921,6 @@ __webpack_require__(908); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function getValue(expression) { - var value = expression.value; - if (!value) { - return { - path: expression.from, - value: "" - }; - } - - if (value.exception) { - return { - path: value.from, - value: value.exception - }; - } - - if (value.error) { - return { - path: value.from, - value: value.error - }; - } - - if (typeof value.result == "object") { - return { - path: value.result.actor, - value: value.result - }; - } - - return { - path: value.input, - value: value.result - }; -} - class Expressions extends _react.PureComponent { constructor() { @@ -27926,23 +28017,18 @@ class Expressions extends _react.PureComponent { return; } - var _getValue = getValue(expression), - value = _getValue.value, - path = _getValue.path; - - if (value.class == "Error") { - value = { unavailable: true }; - } + var _getValue = (0, _expressions.getValue)(expression), + value = _getValue.value; var root = { name: expression.input, - path, + path: input, contents: { value } }; return _react2.default.createElement( "li", - { className: "expression-container", key: `${path}/${input}` }, + { className: "expression-container", key: input }, _react2.default.createElement( "div", { className: "expression-content" }, @@ -27952,12 +28038,12 @@ class Expressions extends _react.PureComponent { disableWrap: true, disabledFocus: true, onDoubleClick: (items, options) => this.editExpression(expression, options), + openLink: openLink, getObjectProperties: id => loadedObjects[id], loadObjectProperties: loadObjectProperties // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. , getObjectEntries: actor => {}, - loadObjectEntries: grip => {}, - openLink: openLink + loadObjectEntries: grip => {} }), _react2.default.createElement( "div", @@ -28016,9 +28102,6 @@ class Expressions extends _react.PureComponent { ); } } - -Expressions.displayName = "Expressions"; - exports.default = (0, _reactRedux.connect)(state => ({ pauseInfo: (0, _selectors.getPause)(state), expressions: (0, _selectors.getExpressions)(state), @@ -28113,7 +28196,6 @@ function renderSourceLocation(source, line, column) { `${(0, _utils.endTruncateStr)(filename, 30)}: ${bpLocation}` ); } -renderSourceLocation.displayName = "SourceLocation"; class Breakpoints extends _react.PureComponent { @@ -28150,29 +28232,31 @@ class Breakpoints extends _react.PureComponent { e.preventDefault(); - var deleteSelfLabel = L10N.getStr("breakpointMenuItem.deleteSelf"); - var deleteAllLabel = L10N.getStr("breakpointMenuItem.deleteAll"); - var deleteOthersLabel = L10N.getStr("breakpointMenuItem.deleteOthers"); - var enableSelfLabel = L10N.getStr("breakpointMenuItem.enableSelf"); - var enableAllLabel = L10N.getStr("breakpointMenuItem.enableAll"); - var enableOthersLabel = L10N.getStr("breakpointMenuItem.enableOthers"); - var disableSelfLabel = L10N.getStr("breakpointMenuItem.disableSelf"); - var disableAllLabel = L10N.getStr("breakpointMenuItem.disableAll"); - var disableOthersLabel = L10N.getStr("breakpointMenuItem.disableOthers"); - var removeConditionLabel = L10N.getStr("breakpointMenuItem.removeCondition.label"); - var editConditionLabel = L10N.getStr("breakpointMenuItem.editCondition.label"); + var deleteSelfLabel = L10N.getStr("breakpointMenuItem.deleteSelf2.label"); + var deleteAllLabel = L10N.getStr("breakpointMenuItem.deleteAll2.label"); + var deleteOthersLabel = L10N.getStr("breakpointMenuItem.deleteOthers2.label"); + var enableSelfLabel = L10N.getStr("breakpointMenuItem.enableSelf2.label"); + var enableAllLabel = L10N.getStr("breakpointMenuItem.enableAll2.label"); + var enableOthersLabel = L10N.getStr("breakpointMenuItem.enableOthers2.label"); + var disableSelfLabel = L10N.getStr("breakpointMenuItem.disableSelf2.label"); + var disableAllLabel = L10N.getStr("breakpointMenuItem.disableAll2.label"); + var disableOthersLabel = L10N.getStr("breakpointMenuItem.disableOthers2.label"); + var removeConditionLabel = L10N.getStr("breakpointMenuItem.removeCondition2.label"); + var addConditionLabel = L10N.getStr("breakpointMenuItem.addCondition2.label"); + var editConditionLabel = L10N.getStr("breakpointMenuItem.editCondition2.label"); - var deleteSelfKey = L10N.getStr("breakpointMenuItem.deleteSelf.accesskey"); - var deleteAllKey = L10N.getStr("breakpointMenuItem.deleteAll.accesskey"); - var deleteOthersKey = L10N.getStr("breakpointMenuItem.deleteOthers.accesskey"); - var enableSelfKey = L10N.getStr("breakpointMenuItem.enableSelf.accesskey"); - var enableAllKey = L10N.getStr("breakpointMenuItem.enableAll.accesskey"); - var enableOthersKey = L10N.getStr("breakpointMenuItem.enableOthers.accesskey"); - var disableSelfKey = L10N.getStr("breakpointMenuItem.disableSelf.accesskey"); - var disableAllKey = L10N.getStr("breakpointMenuItem.disableAll.accesskey"); - var disableOthersKey = L10N.getStr("breakpointMenuItem.disableOthers.accesskey"); - var removeConditionKey = L10N.getStr("breakpointMenuItem.removeCondition.accesskey"); - var editConditionKey = L10N.getStr("breakpointMenuItem.editCondition.accesskey"); + var deleteSelfKey = L10N.getStr("breakpointMenuItem.deleteSelf2.accesskey"); + var deleteAllKey = L10N.getStr("breakpointMenuItem.deleteAll2.accesskey"); + var deleteOthersKey = L10N.getStr("breakpointMenuItem.deleteOthers2.accesskey"); + var enableSelfKey = L10N.getStr("breakpointMenuItem.enableSelf2.accesskey"); + var enableAllKey = L10N.getStr("breakpointMenuItem.enableAll2.accesskey"); + var enableOthersKey = L10N.getStr("breakpointMenuItem.enableOthers2.accesskey"); + var disableSelfKey = L10N.getStr("breakpointMenuItem.disableSelf2.accesskey"); + var disableAllKey = L10N.getStr("breakpointMenuItem.disableAll2.accesskey"); + var disableOthersKey = L10N.getStr("breakpointMenuItem.disableOthers2.accesskey"); + var removeConditionKey = L10N.getStr("breakpointMenuItem.removeCondition2.accesskey"); + var editConditionKey = L10N.getStr("breakpointMenuItem.editCondition2.accesskey"); + var addConditionKey = L10N.getStr("breakpointMenuItem.addCondition2.accesskey"); var otherBreakpoints = breakpoints.filter(b => b !== breakpoint); var enabledBreakpoints = breakpoints.filter(b => !b.disabled); @@ -28259,31 +28343,50 @@ class Breakpoints extends _react.PureComponent { click: () => setBreakpointCondition(breakpoint.location) }; + var addCondition = { + id: "node-menu-add-condition", + label: addConditionLabel, + accesskey: addConditionKey, + click: () => { + this.selectBreakpoint(breakpoint); + toggleConditionalBreakpointPanel(breakpoint.location.line); + } + }; + var editCondition = { id: "node-menu-edit-condition", label: editConditionLabel, accesskey: editConditionKey, - click: () => toggleConditionalBreakpointPanel(breakpoint.location.line) + click: () => { + this.selectBreakpoint(breakpoint); + toggleConditionalBreakpointPanel(breakpoint.location.line); + } }; - var items = [{ item: enableSelf, hidden: () => !breakpoint.disabled }, { item: disableSelf, hidden: () => breakpoint.disabled }, { item: deleteSelf }, { item: deleteAll }, { item: deleteOthers, hidden: () => breakpoints.size === 1 }, { - item: enableAll, - hidden: () => disabledBreakpoints.size === 0 + var hideEnableSelf = !breakpoint.disabled; + var hideEnableAll = disabledBreakpoints.size === 0; + var hideEnableOthers = otherDisabledBreakpoints.size === 0; + var hideDisableAll = enabledBreakpoints.size === 0; + var hideDisableOthers = otherEnabledBreakpoints.size === 0; + var hideDisableSelf = breakpoint.disabled; + + var items = [{ item: enableSelf, hidden: () => hideEnableSelf }, { item: enableAll, hidden: () => hideEnableAll }, { item: enableOthers, hidden: () => hideEnableOthers }, { + item: { type: "separator" }, + hidden: () => hideEnableSelf && hideEnableAll && hideEnableOthers + }, { item: deleteSelf }, { item: deleteAll }, { item: deleteOthers, hidden: () => breakpoints.size === 1 }, { + item: { type: "separator" }, + hidden: () => hideDisableSelf && hideDisableAll && hideDisableOthers + }, { item: disableSelf, hidden: () => hideDisableSelf }, { item: disableAll, hidden: () => hideDisableAll }, { item: disableOthers, hidden: () => hideDisableOthers }, { + item: { type: "separator" } }, { - item: disableAll, - hidden: () => enabledBreakpoints.size === 0 - }, { - item: enableOthers, - hidden: () => otherDisabledBreakpoints.size === 0 - }, { - item: disableOthers, - hidden: () => otherEnabledBreakpoints.size === 0 - }, { - item: removeCondition, - hidden: () => !breakpoint.condition + item: addCondition, + hidden: () => breakpoint.condition }, { item: editCondition, hidden: () => !breakpoint.condition + }, { + item: removeCondition, + hidden: () => !breakpoint.condition }]; (0, _devtoolsLaunchpad.showMenu)(e, (0, _devtoolsLaunchpad.buildMenu)(items)); @@ -28376,8 +28479,6 @@ class Breakpoints extends _react.PureComponent { } } -Breakpoints.displayName = "Breakpoints"; - function updateLocation(sources, pause, bp) { var source = (0, _selectors.getSourceInSources)(sources, bp.location.sourceId); var isCurrentlyPaused = isCurrentlyPausedAtBreakpoint(pause, bp); @@ -28414,10 +28515,6 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -var _reactImmutableProptypes = __webpack_require__(150); - -var _reactImmutableProptypes2 = _interopRequireDefault(_reactImmutableProptypes); - var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(151); @@ -28449,6 +28546,7 @@ function nodeHasProperties(item) { return !nodeHasChildren(item) && item.contents.value.type === "object"; } + function nodeIsPrimitive(item) {} function nodeHasChildren(item) { @@ -28484,13 +28582,10 @@ class Scopes extends _react.Component { prototype = objProps.prototype; - var nodes = Object.keys(ownProperties).sort().filter(name => { - // Ignore non-concrete values like getters and setters - // for now by making sure we have a value. - return "value" in ownProperties[name]; - }).map(name => { - return createNode(name, `${parentPath}/${name}`, ownProperties[name]); - }); + var nodes = Object.keys(ownProperties).sort() + // Ignore non-concrete values like getters and setters + // for now by making sure we have a value. + .filter(name => "value" in ownProperties[name]).map(name => createNode(name, `${parentPath}/${name}`, ownProperties[name])); // Add the prototype if it exists and is not null if (prototype && prototype.type !== "null") { @@ -28642,15 +28737,6 @@ class Scopes extends _react.Component { } } -Scopes.propTypes = { - scopes: _react.PropTypes.array, - loadedObjects: _reactImmutableProptypes2.default.map, - loadObjectProperties: _react.PropTypes.func, - pauseInfo: _react.PropTypes.object -}; - -Scopes.displayName = "Scopes"; - exports.default = (0, _reactRedux.connect)(state => ({ pauseInfo: (0, _selectors.getPause)(state), loadedObjects: (0, _selectors.getLoadedObjects)(state), @@ -28729,8 +28815,7 @@ class Scopes extends _react.PureComponent { var _props2 = this.props, pauseInfo = _props2.pauseInfo, loadObjectProperties = _props2.loadObjectProperties, - loadedObjects = _props2.loadedObjects, - openLink = _props2.openLink; + loadedObjects = _props2.loadedObjects; var scopes = this.state.scopes; @@ -28748,8 +28833,7 @@ class Scopes extends _react.PureComponent { dimTopLevelWindow: true // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. , getObjectEntries: actor => {}, - loadObjectEntries: grip => {}, - openLink: openLink + loadObjectEntries: grip => {} }) ); } @@ -28765,16 +28849,6 @@ class Scopes extends _react.PureComponent { } } -Scopes.propTypes = { - pauseInfo: _react.PropTypes.object, - loadedObjects: _react.PropTypes.object, - loadObjectProperties: _react.PropTypes.func, - selectedFrame: _react.PropTypes.object, - frameScopes: _react.PropTypes.object -}; - -Scopes.displayName = "Scopes"; - exports.default = (0, _reactRedux.connect)(state => { var selectedFrame = (0, _selectors.getSelectedFrame)(state); var frameScopes = selectedFrame ? (0, _selectors.getFrameScopes)(state, selectedFrame.id) : null; @@ -28801,6 +28875,8 @@ exports.getScopes = getScopes; var _lodash = __webpack_require__(2); +var _frame = __webpack_require__(1014); + // Create the tree nodes representing all the variables and arguments // for the bindings from a scope. function getBindingVariables(bindings, parentName) { @@ -28886,7 +28962,7 @@ function getScopes(pauseInfo, selectedFrame, selectedScope) { var bindings = scope.bindings; var title = void 0; if (type === "function") { - title = scope.function.displayName || "(anonymous)"; + title = scope.function.displayName ? (0, _frame.simplifyDisplayName)(scope.function.displayName) : L10N.getStr("anonymous"); } else { title = L10N.getStr("scopes.block"); } @@ -29047,10 +29123,6 @@ class EventListeners extends _react.Component { ); } } - - -EventListeners.displayName = "EventListeners"; - exports.default = (0, _reactRedux.connect)(state => { var listeners = (0, _selectors.getEventListeners)(state).map(l => Object.assign({}, l, { breakpoint: (0, _selectors.getBreakpoint)(state, { @@ -29174,8 +29246,6 @@ class Accordion extends _react.Component { } } -Accordion.displayName = "Accordion"; - exports.default = Accordion; /***/ }), @@ -29292,8 +29362,6 @@ function debugBtn(onClick, type, className, tooltip) { ); } -debugBtn.displayName = "CommandBarButton"; - class CommandBar extends _react.Component { componentWillUnmount() { @@ -29392,8 +29460,6 @@ CommandBar.contextTypes = { shortcuts: _react.PropTypes.object }; -CommandBar.displayName = "CommandBar"; - exports.default = (0, _reactRedux.connect)(state => { return { pause: (0, _selectors.getPause)(state), @@ -29512,8 +29578,6 @@ class WelcomeBox extends _react.Component { } } -WelcomeBox.displayName = "WelcomeBox"; - exports.default = (0, _reactRedux.connect)(state => ({ endPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "end") }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(WelcomeBox); @@ -30017,8 +30081,6 @@ class SourceTabs extends _react.PureComponent { } } -SourceTabs.displayName = "SourceTabs"; - exports.default = (0, _reactRedux.connect)(state => { return { selectedSource: (0, _selectors.getSelectedSource)(state), @@ -30107,8 +30169,6 @@ class Dropdown extends _react.Component { } } -Dropdown.displayName = "Dropdown"; - exports.default = Dropdown; /***/ }), @@ -30390,9 +30450,7 @@ class PreviewFunction extends _react.Component { ); } } - exports.default = PreviewFunction; -PreviewFunction.displayName = "PreviewFunction"; /***/ }), /* 799 */, @@ -30634,8 +30692,6 @@ class Preview extends _react.PureComponent { } } -Preview.displayName = "Preview"; - exports.default = (0, _reactRedux.connect)(state => ({ preview: (0, _selectors.getPreview)(state), selectedSource: (0, _selectors.getSelectedSource)(state), @@ -30763,10 +30819,15 @@ class Popup extends _react.Component { renderSimplePreview(value) { var openLink = this.props.openLink; + return _react2.default.createElement( "div", { className: "preview-popup" }, - Rep({ object: value, mode: MODE.LONG, openLink: openLink }) + Rep({ + object: value, + mode: MODE.LONG, + openLink + }) ); } @@ -30789,12 +30850,12 @@ class Popup extends _react.Component { autoExpandDepth: 0, disableWrap: true, disabledFocus: true, + openLink: openLink, getObjectProperties: getObjectProperties, loadObjectProperties: loadObjectProperties // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. , getObjectEntries: actor => {}, - loadObjectEntries: grip => {}, - openLink: openLink + loadObjectEntries: grip => {} }); } @@ -30853,7 +30914,7 @@ class Popup extends _react.Component { } getPreviewType(value) { - if (typeof value == "boolean" || value.type == "null" || value.type == "undefined" || value.class === "Function") { + if (typeof value == "number" || typeof value == "boolean" || value.type == "null" || value.type == "undefined" || value.class === "Function") { return "tooltip"; } @@ -30879,8 +30940,6 @@ class Popup extends _react.Component { } exports.Popup = Popup; -Popup.displayName = "Popup"; - exports.default = (0, _reactRedux.connect)(state => ({ loadedObjects: (0, _selectors.getLoadedObjects)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Popup); @@ -30911,7 +30970,7 @@ exports.default = (0, _reactRedux.connect)(state => ({ Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearSources = exports.setSource = exports.hasSource = exports.getEmptyLines = exports.getNextStep = exports.clearASTs = exports.clearSymbols = exports.getOutOfScopeLocations = exports.getVariablesInScope = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined; +exports.clearSources = exports.setSource = exports.hasSource = exports.getEmptyLines = exports.getNextStep = exports.clearASTs = exports.clearScopes = exports.clearSymbols = exports.getOutOfScopeLocations = exports.getVariablesInScope = exports.getScopes = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined; var _devtoolsUtils = __webpack_require__(900); @@ -30924,9 +30983,11 @@ var stopParserWorker = exports.stopParserWorker = dispatcher.stop.bind(dispatche var getClosestExpression = exports.getClosestExpression = dispatcher.task("getClosestExpression"); var getSymbols = exports.getSymbols = dispatcher.task("getSymbols"); +var getScopes = exports.getScopes = dispatcher.task("getScopes"); var getVariablesInScope = exports.getVariablesInScope = dispatcher.task("getVariablesInScope"); var getOutOfScopeLocations = exports.getOutOfScopeLocations = dispatcher.task("getOutOfScopeLocations"); var clearSymbols = exports.clearSymbols = dispatcher.task("clearSymbols"); +var clearScopes = exports.clearScopes = dispatcher.task("clearScopes"); var clearASTs = exports.clearASTs = dispatcher.task("clearASTs"); var getNextStep = exports.getNextStep = dispatcher.task("getNextStep"); var getEmptyLines = exports.getEmptyLines = dispatcher.task("getEmptyLines"); @@ -32163,26 +32224,30 @@ Object.defineProperty(exports, "__esModule", { exports.onConnect = undefined; var onConnect = (() => { - var _ref = _asyncToGenerator(function* (connection, options) { + var _ref = _asyncToGenerator(function* (connection, _ref2) { + var services = _ref2.services, + toolboxActions = _ref2.toolboxActions; + // NOTE: the landing page does not connect to a JS process if (!connection) { return; } - var services = options.services; - var toolboxActions = options.toolboxActions; var client = getClient(connection); var commands = client.clientCommands; - var _bootstrapStore = (0, _bootstrap.bootstrapStore)(commands, options), + var _bootstrapStore = (0, _bootstrap.bootstrapStore)(commands, { + services, + toolboxActions + }), store = _bootstrapStore.store, actions = _bootstrapStore.actions, selectors = _bootstrapStore.selectors; (0, _bootstrap.bootstrapWorkers)(); - var _ref2 = yield client.onConnect(connection, actions), - bpClients = _ref2.bpClients; + var _ref3 = yield client.onConnect(connection, actions), + bpClients = _ref3.bpClients; yield loadFromPrefs(actions); @@ -32300,6 +32365,10 @@ var onConnect = exports.onConnect = (() => { wasmBinarySource: supportsWasm }); + threadClient._parent.listWorkers().then(function (workers) { + return actions.setWorkers(workers); + }); + // In Firefox, we need to initially request all of the sources. This // usually fires off individual `newSource` notifications as the // debugger finds them, but there may be existing sources already in @@ -32658,7 +32727,7 @@ function createFrame(frame) { var title = void 0; if (frame.type == "call") { var c = frame.callee; - title = c.name || c.userDisplayName || c.displayName || "(anonymous)"; + title = c.name || c.userDisplayName || c.displayName || L10N.getStr("anonymous"); } else { title = `(${frame.type})`; } @@ -33253,9 +33322,10 @@ var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function bootstrapStore(client, options) { - var services = options.services; - var toolboxActions = options.toolboxActions; +function bootstrapStore(client, _ref) { + var services = _ref.services, + toolboxActions = _ref.toolboxActions; + var createStore = (0, _createStore2.default)({ log: (0, _devtoolsConfig.getValue)("logging.actions"), timing: (0, _devtoolsConfig.getValue)("performance.actions"), @@ -33272,9 +33342,9 @@ function bootstrapStore(client, options) { return { store, actions, selectors: _selectors2.default }; } -function bootstrapApp(connection, _ref) { - var store = _ref.store, - actions = _ref.actions; +function bootstrapApp(connection, _ref2) { + var store = _ref2.store, + actions = _ref2.actions; window.appStore = store; @@ -33329,7 +33399,7 @@ const { generatedToOriginalId, isGeneratedId, isOriginalId -} = __webpack_require__(899); +} = __webpack_require__(1172); const { workerUtils: { WorkerDispatcher } } = __webpack_require__(1165); @@ -33338,6 +33408,7 @@ const dispatcher = new WorkerDispatcher(); const getOriginalURLs = dispatcher.task("getOriginalURLs"); const getGeneratedLocation = dispatcher.task("getGeneratedLocation"); const getOriginalLocation = dispatcher.task("getOriginalLocation"); +const getLocationScopes = dispatcher.task("getLocationScopes"); const getOriginalSourceText = dispatcher.task("getOriginalSourceText"); const applySourceMap = dispatcher.task("applySourceMap"); const clearSourceMaps = dispatcher.task("clearSourceMaps"); @@ -33352,6 +33423,7 @@ module.exports = { getOriginalURLs, getGeneratedLocation, getOriginalLocation, + getLocationScopes, getOriginalSourceText, applySourceMap, clearSourceMaps, @@ -33360,86 +33432,7 @@ module.exports = { }; /***/ }), -/* 899 */ -/***/ (function(module, exports, __webpack_require__) { - -/* 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/. */ - -const md5 = __webpack_require__(248); - -function originalToGeneratedId(originalId) { - const match = originalId.match(/(.*)\/originalSource/); - return match ? match[1] : ""; -} - -function generatedToOriginalId(generatedId, url) { - return `${generatedId}/originalSource-${md5(url)}`; -} - -function isOriginalId(id) { - return !!id.match(/\/originalSource/); -} - -function isGeneratedId(id) { - return !isOriginalId(id); -} - -/** - * Trims the query part or reference identifier of a URL string, if necessary. - */ -function trimUrlQuery(url) { - let length = url.length; - let q1 = url.indexOf("?"); - let q2 = url.indexOf("&"); - let q3 = url.indexOf("#"); - let q = Math.min(q1 != -1 ? q1 : length, q2 != -1 ? q2 : length, q3 != -1 ? q3 : length); - - return url.slice(0, q); -} - -// Map suffix to content type. -const contentMap = { - "js": "text/javascript", - "jsm": "text/javascript", - "ts": "text/typescript", - "tsx": "text/typescript-jsx", - "jsx": "text/jsx", - "coffee": "text/coffeescript", - "elm": "text/elm", - "cljs": "text/x-clojure" -}; - -/** - * Returns the content type for the specified URL. If no specific - * content type can be determined, "text/plain" is returned. - * - * @return String - * The content type. - */ -function getContentType(url) { - url = trimUrlQuery(url); - let dot = url.lastIndexOf("."); - if (dot >= 0) { - let name = url.substring(dot + 1); - if (name in contentMap) { - return contentMap[name]; - } - } - return "text/plain"; -} - -module.exports = { - originalToGeneratedId, - generatedToOriginalId, - isOriginalId, - isGeneratedId, - getContentType, - contentMapForTesting: contentMap -}; - -/***/ }), +/* 899 */, /* 900 */ /***/ (function(module, exports, __webpack_require__) { @@ -33631,10 +33624,9 @@ var prettyPrint = exports.prettyPrint = (() => { var source = _ref2.source, url = _ref2.url; - var contentType = source.contentType; var indent = 2; - (0, _assert2.default)((0, _source.isJavaScript)(source.url, contentType), "Can't prettify non-javascript files."); + (0, _assert2.default)((0, _source.isJavaScript)(source), "Can't prettify non-javascript files."); return yield _prettyPrint({ url, @@ -38390,7 +38382,7 @@ module.exports = { /* 960 */ /***/ (function(module, exports) { -module.exports = "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\n# LOCALIZATION NOTE These strings are used inside the Debugger\n# which is available from the Web Developer sub-menu -> 'Debugger'.\n# The correct localization of this file might be to keep it in\n# English, or another language commonly spoken among web developers.\n# You want to make that choice consistent across the developer tools.\n# A good criteria is the language in which you'd find the best\n# documentation on web development on the web.\n\n# LOCALIZATION NOTE (collapsePanes): This is the tooltip for the button\n# that collapses the left and right panes in the debugger UI.\ncollapsePanes=Collapse panes\n\n# LOCALIZATION NOTE (copySource): This is the text that appears in the\n# context menu to copy the selected source of file open.\ncopySource=Copy\ncopySource.accesskey=y\n\n# LOCALIZATION NOTE (copySourceUrl): This is the text that appears in the\n# context menu to copy the source URL of file open.\ncopySourceUrl=Copy Source URL\ncopySourceUrl.accesskey=u\n\n# LOCALIZATION NOTE (copyFunction): This is the text that appears in the\n# context menu to copy the function the user selected\ncopyFunction.label=Copy Function\ncopyFunction.accesskey=F\n\n# LOCALIZATION NOTE (copyStackTrace): This is the text that appears in the\n# context menu to copy the stack trace methods, file names and row number.\ncopyStackTrace=Copy Stack Trace\ncopyStackTrace.accesskey=c\n\n# LOCALIZATION NOTE (expandPanes): This is the tooltip for the button\n# that expands the left and right panes in the debugger UI.\nexpandPanes=Expand panes\n\n# LOCALIZATION NOTE (pauseButtonTooltip): The tooltip that is displayed for the pause\n# button when the debugger is in a running state.\npauseButtonTooltip=Pause %S\n\n# LOCALIZATION NOTE (pausePendingButtonTooltip): The tooltip that is displayed for\n# the pause button after it's been clicked but before the next JavaScript to run.\npausePendingButtonTooltip=Waiting for next execution\n\n# LOCALIZATION NOTE (resumeButtonTooltip): The label that is displayed on the pause\n# button when the debugger is in a paused state.\nresumeButtonTooltip=Resume %S\n\n# LOCALIZATION NOTE (stepOverTooltip): The label that is displayed on the\n# button that steps over a function call.\nstepOverTooltip=Step Over %S\n\n# LOCALIZATION NOTE (stepInTooltip): The label that is displayed on the\n# button that steps into a function call.\nstepInTooltip=Step In %S\n\n# LOCALIZATION NOTE (stepOutTooltip): The label that is displayed on the\n# button that steps out of a function call.\nstepOutTooltip=Step Out %S\n\n# LOCALIZATION NOTE (workersHeader): The text to display in the events\n# header.\nworkersHeader=Workers\n\n# LOCALIZATION NOTE (noWorkersText): The text to display in the workers list\n# when there are no workers.\nnoWorkersText=This page has no workers.\n\n# LOCALIZATION NOTE (noSourcesText): The text to display in the sources list\n# when there are no sources.\nnoSourcesText=This page has no sources.\n\n# LOCALIZATION NOTE (noEventListenersText): The text to display in the events tab\n# when there are no events.\nnoEventListenersText=No event listeners to display\n\n# LOCALIZATION NOTE (eventListenersHeader): The text to display in the events\n# header.\neventListenersHeader=Event Listeners\n\n# LOCALIZATION NOTE (noStackFramesText): The text to display in the call stack tab\n# when there are no stack frames.\nnoStackFramesText=No stack frames to display\n\n# LOCALIZATION NOTE (eventCheckboxTooltip): The tooltip text to display when\n# the user hovers over the checkbox used to toggle an event breakpoint.\neventCheckboxTooltip=Toggle breaking on this event\n\n# LOCALIZATION NOTE (eventOnSelector): The text to display in the events tab\n# for every event item, between the event type and event selector.\neventOnSelector=on\n\n# LOCALIZATION NOTE (eventInSource): The text to display in the events tab\n# for every event item, between the event selector and listener's owner source.\neventInSource=in\n\n# LOCALIZATION NOTE (eventNodes): The text to display in the events tab when\n# an event is listened on more than one target node.\neventNodes=%S nodes\n\n# LOCALIZATION NOTE (eventNative): The text to display in the events tab when\n# a listener is added from plugins, thus getting translated to native code.\neventNative=[native code]\n\n# LOCALIZATION NOTE (*Events): The text to display in the events tab for\n# each group of sub-level event entries.\nanimationEvents=Animation\naudioEvents=Audio\nbatteryEvents=Battery\nclipboardEvents=Clipboard\ncompositionEvents=Composition\ndeviceEvents=Device\ndisplayEvents=Display\ndragAndDropEvents=Drag and Drop\ngamepadEvents=Gamepad\nindexedDBEvents=IndexedDB\ninteractionEvents=Interaction\nkeyboardEvents=Keyboard\nmediaEvents=HTML5 Media\nmouseEvents=Mouse\nmutationEvents=Mutation\nnavigationEvents=Navigation\npointerLockEvents=Pointer Lock\nsensorEvents=Sensor\nstorageEvents=Storage\ntimeEvents=Time\ntouchEvents=Touch\notherEvents=Other\n\n# LOCALIZATION NOTE (blackboxCheckboxTooltip2): The tooltip text to display when\n# the user hovers over the checkbox used to toggle blackboxing its associated\n# source.\nblackboxCheckboxTooltip2=Toggle blackboxing\n\n# LOCALIZATION NOTE (sources.search.key2): Key shortcut to open the search for\n# searching all the source files the debugger has seen.\nsources.search.key2=CmdOrCtrl+P\n\n# LOCALIZATION NOTE (sources.search.alt.key): A second key shortcut to open the\n# search for searching all the source files the debugger has seen.\nsources.search.alt.key=CmdOrCtrl+O\n\n# LOCALIZATION NOTE (projectTextSearch.key): A key shortcut to open the\n# full project text search for searching all the files the debugger has seen.\nprojectTextSearch.key=CmdOrCtrl+Shift+F\n\n# LOCALIZATION NOTE (functionSearch.key): A key shortcut to open the\n# modal for searching functions in a file.\nfunctionSearch.key=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE (projectTextSearch.placeholder): A placeholder shown\n# when searching across all of the files in a project.\nprojectTextSearch.placeholder=Find in files…\n\n# LOCALIZATION NOTE (projectTextSearch.noResults): The center pane Text Search\n# message when the query did not match any text of all files in a project.\nprojectTextSearch.noResults=No results found\n\n# LOCALIZATION NOTE (sources.noSourcesAvailable): Text shown when the debugger\n# does not have any sources.\nsources.noSourcesAvailable=This page has no sources\n\n# LOCALIZATION NOTE (sourceSearch.search.key2): Key shortcut to open the search\n# for searching within a the currently opened files in the editor\nsourceSearch.search.key2=CmdOrCtrl+F\n\n# LOCALIZATION NOTE (sourceSearch.search.placeholder): placeholder text in\n# the source search input bar\nsourceSearch.search.placeholder=Search in file…\n\n# LOCALIZATION NOTE (sourceSearch.search.again.key2): Key shortcut to highlight\n# the next occurrence of the last search triggered from a source search\nsourceSearch.search.again.key2=CmdOrCtrl+G\n\n# LOCALIZATION NOTE (sourceSearch.search.againPrev.key2): Key shortcut to highlight\n# the previous occurrence of the last search triggered from a source search\nsourceSearch.search.againPrev.key2=CmdOrCtrl+Shift+G\n\n# LOCALIZATION NOTE (sourceSearch.resultsSummary1): Shows a summary of\n# the number of matches for autocomplete\nsourceSearch.resultsSummary1=%d results\n\n# LOCALIZATION NOTE (noMatchingStringsText): The text to display in the\n# global search results when there are no matching strings after filtering.\nnoMatchingStringsText=No matches found\n\n# LOCALIZATION NOTE (emptySearchText): This is the text that appears in the\n# filter text box when it is empty and the scripts container is selected.\nemptySearchText=Search scripts (%S)\n\n# LOCALIZATION NOTE (emptyVariablesFilterText): This is the text that\n# appears in the filter text box for the variables view container.\nemptyVariablesFilterText=Filter variables\n\n# LOCALIZATION NOTE (emptyPropertiesFilterText): This is the text that\n# appears in the filter text box for the editor's variables view bubble.\nemptyPropertiesFilterText=Filter properties\n\n# LOCALIZATION NOTE (searchPanelFilter): This is the text that appears in the\n# filter panel popup for the filter scripts operation.\nsearchPanelFilter=Filter scripts (%S)\n\n# LOCALIZATION NOTE (searchPanelGlobal): This is the text that appears in the\n# filter panel popup for the global search operation.\nsearchPanelGlobal=Search in all files (%S)\n\n# LOCALIZATION NOTE (searchPanelFunction): This is the text that appears in the\n# filter panel popup for the function search operation.\nsearchPanelFunction=Search for function definition (%S)\n\n# LOCALIZATION NOTE (searchPanelToken): This is the text that appears in the\n# filter panel popup for the token search operation.\nsearchPanelToken=Find in this file (%S)\n\n# LOCALIZATION NOTE (searchPanelGoToLine): This is the text that appears in the\n# filter panel popup for the line search operation.\nsearchPanelGoToLine=Go to line (%S)\n\n# LOCALIZATION NOTE (searchPanelVariable): This is the text that appears in the\n# filter panel popup for the variables search operation.\nsearchPanelVariable=Filter variables (%S)\n\n# LOCALIZATION NOTE (breakpointMenuItem): The text for all the elements that\n# are displayed in the breakpoints menu item popup.\nbreakpointMenuItem.setConditional=Configure conditional breakpoint\nbreakpointMenuItem.enableSelf=Enable breakpoint\nbreakpointMenuItem.enableSelf.accesskey=E\nbreakpointMenuItem.disableSelf=Disable breakpoint\nbreakpointMenuItem.disableSelf.accesskey=D\nbreakpointMenuItem.deleteSelf=Remove breakpoint\nbreakpointMenuItem.deleteSelf.accesskey=R\nbreakpointMenuItem.enableOthers=Enable others\nbreakpointMenuItem.enableOthers.accesskey=o\nbreakpointMenuItem.disableOthers=Disable others\nbreakpointMenuItem.disableOthers.accesskey=s\nbreakpointMenuItem.deleteOthers=Remove others\nbreakpointMenuItem.deleteOthers.accesskey=h\nbreakpointMenuItem.enableAll=Enable all breakpoints\nbreakpointMenuItem.enableAll.accesskey=b\nbreakpointMenuItem.disableAll=Disable all breakpoints\nbreakpointMenuItem.disableAll.accesskey=k\nbreakpointMenuItem.deleteAll=Remove all breakpoints\nbreakpointMenuItem.deleteAll.accesskey=a\nbreakpointMenuItem.removeCondition.label=Remove breakpoint condition\nbreakpointMenuItem.removeCondition.accesskey=c\nbreakpointMenuItem.editCondition.label=Edit breakpoint condition\nbreakpointMenuItem.editCondition.accesskey=n\n\n# LOCALIZATION NOTE (breakpoints.header): Breakpoints right sidebar pane header.\nbreakpoints.header=Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.none): The text that appears when there are\n# no breakpoints present\nbreakpoints.none=No Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.enable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.enable=Enable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.disable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.disable=Disable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.removeBreakpointTooltip): The tooltip that is displayed\n# for remove breakpoint button in right sidebar\nbreakpoints.removeBreakpointTooltip=Remove Breakpoint\n\n# LOCALIZATION NOTE (callStack.header): Call Stack right sidebar pane header.\ncallStack.header=Call Stack\n\n# LOCALIZATION NOTE (callStack.notPaused): Call Stack right sidebar pane\n# message when not paused.\ncallStack.notPaused=Not Paused\n\n# LOCALIZATION NOTE (callStack.collapse): Call Stack right sidebar pane\n# message to hide some of the frames that are shown.\ncallStack.collapse=Collapse Rows\n\n# LOCALIZATION NOTE (callStack.expand): Call Stack right sidebar pane\n# message to show more of the frames.\ncallStack.expand=Expand Rows\n\n# LOCALIZATION NOTE (editor.searchResults): Editor Search bar message\n# for the summarizing the selected search result. e.g. 5 of 10 results.\neditor.searchResults=%d of %d results\n\n# LOCALIZATION NOTE (sourceSearch.singleResult): Copy shown when there is one result.\neditor.singleResult=1 result\n\n# LOCALIZATION NOTE (editor.noResults): Editor Search bar message\n# for when no results found.\neditor.noResults=no results\n\n# LOCALIZATION NOTE (editor.searchResults.nextResult): Editor Search bar\n# tooltip for traversing to the Next Result\neditor.searchResults.nextResult=Next Result\n\n# LOCALIZATION NOTE (editor.searchResults.prevResult): Editor Search bar\n# tooltip for traversing to the Previous Result\neditor.searchResults.prevResult=Previous Result\n\n# LOCALIZATION NOTE (editor.searchTypeToggleTitle): Search bar title for\n# toggling search type buttons(function search, variable search)\neditor.searchTypeToggleTitle=Search for:\n\n# LOCALIZATION NOTE (editor.continueToHere.label): Editor gutter context\n# menu item for jumping to a new paused location\neditor.continueToHere.label=Continue To Here\neditor.continueToHere.accesskey=H\n\n# LOCALIZATION NOTE (editor.addBreakpoint): Editor gutter context menu item\n# for adding a breakpoint on a line.\neditor.addBreakpoint=Add Breakpoint\n\n# LOCALIZATION NOTE (editor.disableBreakpoint): Editor gutter context menu item\n# for disabling a breakpoint on a line.\neditor.disableBreakpoint=Disable Breakpoint\n\n# LOCALIZATION NOTE (editor.enableBreakpoint): Editor gutter context menu item\n# for enabling a breakpoint on a line.\neditor.enableBreakpoint=Enable Breakpoint\n\n# LOCALIZATION NOTE (editor.removeBreakpoint): Editor gutter context menu item\n# for removing a breakpoint on a line.\neditor.removeBreakpoint=Remove Breakpoint\n\n# LOCALIZATION NOTE (editor.editBreakpoint): Editor gutter context menu item\n# for setting a breakpoint condition on a line.\neditor.editBreakpoint=Edit Breakpoint\n\n# LOCALIZATION NOTE (editor.addConditionalBreakpoint): Editor gutter context\n# menu item for adding a breakpoint condition on a line.\neditor.addConditionalBreakpoint=Add Conditional Breakpoint\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Placeholder text for\n# input element inside ConditionalPanel component\neditor.conditionalPanel.placeholder=This breakpoint will pause when the expression is true\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Tooltip text for\n# close button inside ConditionalPanel component\neditor.conditionalPanel.close=Cancel edit breakpoint and close\n\n# LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item\n# for navigating to a source mapped location\neditor.jumpToMappedLocation1=Jump to %S Location\n\n# LOCALIZATION NOTE (framework.disableGrouping): This is the text that appears in the\n# context menu to disable framework grouping.\nframework.disableGrouping=Disable Framework Grouping\nframework.disableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (framework.enableGrouping): This is the text that appears in the\n# context menu to enable framework grouping.\nframework.enableGrouping=Enable Framework Grouping\nframework.enableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (generated): Source Map term for a server source location\ngenerated=Generated\n\n# LOCALIZATION NOTE (original): Source Map term for a debugger UI source location\noriginal=Original\n\n# LOCALIZATION NOTE (expressions.placeholder): Placeholder text for expression\n# input element\nexpressions.placeholder=Add Watch Expression\n\n# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item\n# for closing the selected tab below the mouse.\nsourceTabs.closeTab=Close Tab\nsourceTabs.closeTab.accesskey=c\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs): Editor source tab context menu item\n# for closing the other tabs.\nsourceTabs.closeOtherTabs=Close Other Tabs\nsourceTabs.closeOtherTabs.accesskey=o\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd): Editor source tab context menu item\n# for closing the tabs to the end (the right for LTR languages) of the selected tab.\nsourceTabs.closeTabsToEnd=Close Tabs to the Right\nsourceTabs.closeTabsToEnd.accesskey=e\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs): Editor source tab context menu item\n# for closing all tabs.\nsourceTabs.closeAllTabs=Close All Tabs\nsourceTabs.closeAllTabs.accesskey=a\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree): Editor source tab context menu item\n# for revealing source in tree.\nsourceTabs.revealInTree=Reveal in Tree\nsourceTabs.revealInTree.accesskey=r\n\n# LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item\n# for copying a link address.\nsourceTabs.copyLink=Copy Link Address\nsourceTabs.copyLink.accesskey=l\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item\n# for pretty printing the source.\nsourceTabs.prettyPrint=Pretty Print Source\nsourceTabs.prettyPrint.accesskey=p\n\n# LOCALIZATION NOTE (sourceFooter.blackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.blackbox=Blackbox Source\nsourceFooter.blackbox.accesskey=B\n\n# LOCALIZATION NOTE (sourceFooter.unblackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.unblackbox=Unblackbox Source\nsourceFooter.unblackbox.accesskey=b\n\n# LOCALIZATION NOTE (sourceFooter.blackboxed): Text associated\n# with a blackboxed source\nsourceFooter.blackboxed=Blackboxed Source\n\n# LOCALIZATION NOTE (sourceFooter.codeCoverage): Text associated\n# with a code coverage button\nsourceFooter.codeCoverage=Code Coverage\n\n# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed\n# for close tab button in source tabs.\nsourceTabs.closeTabButtonTooltip=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.newTabButtonTooltip): The tooltip that is displayed for\n# new tab button in source tabs.\nsourceTabs.newTabButtonTooltip=Search for sources (%S)\n\n# LOCALIZATION NOTE (scopes.header): Scopes right sidebar pane header.\nscopes.header=Scopes\n\n# LOCALIZATION NOTE (scopes.notAvailable): Scopes right sidebar pane message\n# for when the debugger is paused, but there isn't pause data.\nscopes.notAvailable=Scopes Unavailable\n\n# LOCALIZATION NOTE (scopes.notPaused): Scopes right sidebar pane message\n# for when the debugger is not paused.\nscopes.notPaused=Not Paused\n\n# LOCALIZATION NOTE (scopes.block): Refers to a block of code in\n# the scopes pane when the debugger is paused.\nscopes.block=Block\n\n# LOCALIZATION NOTE (sources.header): Sources left sidebar header\nsources.header=Sources\n\n# LOCALIZATION NOTE (outline.header): Outline left sidebar header\noutline.header=Outline\n\n# LOCALIZATION NOTE (outline.noFunctions): Outline text when there are no functions to display\noutline.noFunctions=No functions\n\n# LOCALIZATION NOTE (sources.search): Sources left sidebar prompt\n# e.g. Cmd+P to search. On a mac, we use the command unicode character.\n# On windows, it's ctrl.\nsources.search=%S to search\n\n# LOCALIZATION NOTE (watchExpressions.header): Watch Expressions right sidebar\n# pane header.\nwatchExpressions.header=Watch Expressions\n\n# LOCALIZATION NOTE (watchExpressions.refreshButton): Watch Expressions header\n# button for refreshing the expressions.\nwatchExpressions.refreshButton=Refresh\n\n# LOCALIZATION NOTE (welcome.search): The center pane welcome panel's\n# search prompt. e.g. cmd+p to search for files. On windows, it's ctrl, on\n# a mac we use the unicode character.\nwelcome.search=%S to search for sources\n\n# LOCALIZATION NOTE (welcome.findInFiles): The center pane welcome panel's\n# search prompt. e.g. cmd+f to search for files. On windows, it's ctrl+shift+f, on\n# a mac we use the unicode character.\nwelcome.findInFiles=%S to find in files\n\n# LOCALIZATION NOTE (welcome.searchFunction): Label displayed in the welcome\n# panel. %S is replaced by the keyboard shortcut to search for functions.\nwelcome.searchFunction=%S to search for functions in file\n\n# LOCALIZATION NOTE (sourceSearch.search): The center pane Source Search\n# prompt for searching for files.\nsourceSearch.search=Search sources…\n\n# LOCALIZATION NOTE (sourceSearch.noResults): The center pane Source Search\n# message when the query did not match any of the sources.\nsourceSearch.noResults2=No results found\n\n# LOCALIZATION NOTE (ignoreExceptions): The pause on exceptions button tooltip\n# when the debugger will not pause on exceptions.\nignoreExceptions=Ignore exceptions. Click to pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptions): The pause on exceptions button\n# tooltip when the debugger will pause on uncaught exceptions.\npauseOnUncaughtExceptions=Pause on uncaught exceptions. Click to pause on all exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptions): The pause on exceptions button tooltip\n# when the debugger will pause on all exceptions.\npauseOnExceptions=Pause on all exceptions. Click to ignore exceptions\n\n# LOCALIZATION NOTE (loadingText): The text that is displayed in the script\n# editor when the loading process has started but there is no file to display\n# yet.\nloadingText=Loading\\u2026\n\n# LOCALIZATION NOTE (errorLoadingText2): The text that is displayed in the debugger\n# viewer when there is an error loading a file\nerrorLoadingText2=Error loading this URL: %S\n\n# LOCALIZATION NOTE (addWatchExpressionText): The text that is displayed in the\n# watch expressions list to add a new item.\naddWatchExpressionText=Add watch expression\n\n# LOCALIZATION NOTE (addWatchExpressionButton): The button that is displayed in the\n# variables view popup.\naddWatchExpressionButton=Watch\n\n# LOCALIZATION NOTE (emptyVariablesText): The text that is displayed in the\n# variables pane when there are no variables to display.\nemptyVariablesText=No variables to display\n\n# LOCALIZATION NOTE (scopeLabel): The text that is displayed in the variables\n# pane as a header for each variable scope (e.g. \"Global scope, \"With scope\",\n# etc.).\nscopeLabel=%S scope\n\n# LOCALIZATION NOTE (watchExpressionsScopeLabel): The name of the watch\n# expressions scope. This text is displayed in the variables pane as a header for\n# the watch expressions scope.\nwatchExpressionsScopeLabel=Watch expressions\n\n# LOCALIZATION NOTE (globalScopeLabel): The name of the global scope. This text\n# is added to scopeLabel and displayed in the variables pane as a header for\n# the global scope.\nglobalScopeLabel=Global\n\n# LOCALIZATION NOTE (variablesViewErrorStacktrace): This is the text that is\n# shown before the stack trace in an error.\nvariablesViewErrorStacktrace=Stack trace:\n\n# LOCALIZATION NOTE (variablesViewMoreObjects): the text that is displayed\n# when you have an object preview that does not show all of the elements. At the end of the list\n# you see \"N more...\" in the web console output.\n# This is a semi-colon list of plural forms.\n# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals\n# #1 number of remaining items in the object\n# example: 3 more…\nvariablesViewMoreObjects=#1 more…;#1 more…\n\n# LOCALIZATION NOTE (variablesEditableNameTooltip): The text that is displayed\n# in the variables list on an item with an editable name.\nvariablesEditableNameTooltip=Double click to edit\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in the variables list on an item with an editable value.\nvariablesEditableValueTooltip=Click to change value\n\n# LOCALIZATION NOTE (variablesCloseButtonTooltip): The text that is displayed\n# in the variables list on an item which can be removed.\nvariablesCloseButtonTooltip=Click to remove\n\n# LOCALIZATION NOTE (variablesEditButtonTooltip): The text that is displayed\n# in the variables list on a getter or setter which can be edited.\nvariablesEditButtonTooltip=Click to set value\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in a tooltip on the \"open in inspector\" button in the the variables list for a\n# DOMNode item.\nvariablesDomNodeValueTooltip=Click to select the node in the inspector\n\n# LOCALIZATION NOTE (configurable|...|Tooltip): The text that is displayed\n# in the variables list on certain variables or properties as tooltips.\n# Expanations of what these represent can be found at the following links:\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed\n# It's probably best to keep these in English.\nconfigurableTooltip=configurable\nenumerableTooltip=enumerable\nwritableTooltip=writable\nfrozenTooltip=frozen\nsealedTooltip=sealed\nextensibleTooltip=extensible\noverriddenTooltip=overridden\nWebIDLTooltip=WebIDL\n\n# LOCALIZATION NOTE (variablesSeparatorLabel): The text that is displayed\n# in the variables list as a separator between the name and value.\nvariablesSeparatorLabel=:\n\n# LOCALIZATION NOTE (watchExpressionsSeparatorLabel2): The text that is displayed\n# in the watch expressions list as a separator between the code and evaluation.\nwatchExpressionsSeparatorLabel2=\\u0020→\n\n# LOCALIZATION NOTE (functionSearchSeparatorLabel): The text that is displayed\n# in the functions search panel as a separator between function's inferred name\n# and its real name (if available).\nfunctionSearchSeparatorLabel=←\n\n# LOCALIZATION NOTE(symbolSearch.search.functionsPlaceholder): The placeholder\n# text displayed when the user searches for functions in a file\nsymbolSearch.search.functionsPlaceholder=Search functions…\n\n# LOCALIZATION NOTE(symbolSearch.search.variablesPlaceholder): The placeholder\n# text displayed when the user searches for variables in a file\nsymbolSearch.search.variablesPlaceholder=Search variables…\n\n# LOCALIZATION NOTE(symbolSearch.search.key2): The Key Shortcut for\n# searching for a function or variable\nsymbolSearch.search.key2=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.modifiersLabel): A label\n# preceding the group of modifiers\nsymbolSearch.searchModifier.modifiersLabel=Modifiers:\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.regex): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.regex=Regex\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.caseSensitive): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.caseSensitive=Case sensitive\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.wholeWord): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.wholeWord=Whole word\n\n# LOCALIZATION NOTE (resumptionOrderPanelTitle): This is the text that appears\n# as a description in the notification panel popup, when multiple debuggers are\n# open in separate tabs and the user tries to resume them in the wrong order.\n# The substitution parameter is the URL of the last paused window that must be\n# resumed first.\nresumptionOrderPanelTitle=There are one or more paused debuggers. Please resume the most-recently paused debugger first at: %S\n\nvariablesViewOptimizedOut=(optimized away)\nvariablesViewUninitialized=(uninitialized)\nvariablesViewMissingArgs=(unavailable)\n\nanonymousSourcesLabel=Anonymous Sources\n\nexperimental=This is an experimental feature\n\n# LOCALIZATION NOTE (whyPaused.debuggerStatement): The text that is displayed\n# in a info block explaining how the debugger is currently paused due to a `debugger`\n# statement in the code\nwhyPaused.debuggerStatement=Paused on debugger statement\n\n# LOCALIZATION NOTE (whyPaused.breakpoint): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a breakpoint\nwhyPaused.breakpoint=Paused on breakpoint\n\n# LOCALIZATION NOTE (whyPaused.exception): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an exception\nwhyPaused.exception=Paused on exception\n\n# LOCALIZATION NOTE (whyPaused.resumeLimit): The text that is displayed\n# in a info block explaining how the debugger is currently paused while stepping\n# in or out of the stack\nwhyPaused.resumeLimit=Paused while stepping\n\n# LOCALIZATION NOTE (whyPaused.pauseOnDOMEvents): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# dom event\nwhyPaused.pauseOnDOMEvents=Paused on event listener\n\n# LOCALIZATION NOTE (whyPaused.breakpointConditionThrown): The text that is displayed\n# in an info block when evaluating a conditional breakpoint throws an error\nwhyPaused.breakpointConditionThrown=Error with conditional breakpoint\n\n# LOCALIZATION NOTE (whyPaused.xhr): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# xml http request\nwhyPaused.xhr=Paused on XMLHttpRequest\n\n# LOCALIZATION NOTE (whyPaused.promiseRejection): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# promise rejection\nwhyPaused.promiseRejection=Paused on promise rejection\n\n# LOCALIZATION NOTE (whyPaused.assert): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# assert\nwhyPaused.assert=Paused on assertion\n\n# LOCALIZATION NOTE (whyPaused.debugCommand): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# debugger statement\nwhyPaused.debugCommand=Paused on debugged function\n\n# LOCALIZATION NOTE (whyPaused.other): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an event\n# listener breakpoint set\nwhyPaused.other=Debugger paused\n\n# LOCALIZATION NOTE (ctrl): The text that is used for documenting\n# keyboard shortcuts that use the control key\nctrl=Ctrl\n" +module.exports = "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\n# LOCALIZATION NOTE These strings are used inside the Debugger\n# which is available from the Web Developer sub-menu -> 'Debugger'.\n# The correct localization of this file might be to keep it in\n# English, or another language commonly spoken among web developers.\n# You want to make that choice consistent across the developer tools.\n# A good criteria is the language in which you'd find the best\n# documentation on web development on the web.\n\n# LOCALIZATION NOTE (collapsePanes): This is the tooltip for the button\n# that collapses the left and right panes in the debugger UI.\ncollapsePanes=Collapse panes\n\n# LOCALIZATION NOTE (copySource): This is the text that appears in the\n# context menu to copy the selected source of file open.\ncopySource=Copy\ncopySource.accesskey=y\n\n# LOCALIZATION NOTE (copySourceUrl): This is the text that appears in the\n# context menu to copy the source URL of file open.\ncopySourceUrl=Copy source url\ncopySourceUrl.accesskey=u\n\n# LOCALIZATION NOTE (copyFunction): This is the text that appears in the\n# context menu to copy the function the user selected\ncopyFunction.label=Copy function\ncopyFunction.accesskey=F\n\n# LOCALIZATION NOTE (copyStackTrace): This is the text that appears in the\n# context menu to copy the stack trace methods, file names and row number.\ncopyStackTrace=Copy stack trace\ncopyStackTrace.accesskey=c\n\n# LOCALIZATION NOTE (expandPanes): This is the tooltip for the button\n# that expands the left and right panes in the debugger UI.\nexpandPanes=Expand panes\n\n# LOCALIZATION NOTE (pauseButtonTooltip): The tooltip that is displayed for the pause\n# button when the debugger is in a running state.\npauseButtonTooltip=Pause %S\n\n# LOCALIZATION NOTE (pausePendingButtonTooltip): The tooltip that is displayed for\n# the pause button after it's been clicked but before the next JavaScript to run.\npausePendingButtonTooltip=Waiting for next execution\n\n# LOCALIZATION NOTE (resumeButtonTooltip): The label that is displayed on the pause\n# button when the debugger is in a paused state.\nresumeButtonTooltip=Resume %S\n\n# LOCALIZATION NOTE (stepOverTooltip): The label that is displayed on the\n# button that steps over a function call.\nstepOverTooltip=Step over %S\n\n# LOCALIZATION NOTE (stepInTooltip): The label that is displayed on the\n# button that steps into a function call.\nstepInTooltip=Step in %S\n\n# LOCALIZATION NOTE (stepOutTooltip): The label that is displayed on the\n# button that steps out of a function call.\nstepOutTooltip=Step out %S\n\n# LOCALIZATION NOTE (workersHeader): The text to display in the events\n# header.\nworkersHeader=Workers\n\n# LOCALIZATION NOTE (noWorkersText): The text to display in the workers list\n# when there are no workers.\nnoWorkersText=This page has no workers.\n\n# LOCALIZATION NOTE (noSourcesText): The text to display in the sources list\n# when there are no sources.\nnoSourcesText=This page has no sources.\n\n# LOCALIZATION NOTE (noEventListenersText): The text to display in the events tab\n# when there are no events.\nnoEventListenersText=No event listeners to display.\n\n# LOCALIZATION NOTE (eventListenersHeader): The text to display in the events\n# header.\neventListenersHeader=Event listeners\n\n# LOCALIZATION NOTE (noStackFramesText): The text to display in the call stack tab\n# when there are no stack frames.\nnoStackFramesText=No stack frames to display\n\n# LOCALIZATION NOTE (eventCheckboxTooltip): The tooltip text to display when\n# the user hovers over the checkbox used to toggle an event breakpoint.\neventCheckboxTooltip=Toggle breaking on this event\n\n# LOCALIZATION NOTE (eventOnSelector): The text to display in the events tab\n# for every event item, between the event type and event selector.\neventOnSelector=on\n\n# LOCALIZATION NOTE (eventInSource): The text to display in the events tab\n# for every event item, between the event selector and listener's owner source.\neventInSource=in\n\n# LOCALIZATION NOTE (eventNodes): The text to display in the events tab when\n# an event is listened on more than one target node.\neventNodes=%S nodes\n\n# LOCALIZATION NOTE (eventNative): The text to display in the events tab when\n# a listener is added from plugins, thus getting translated to native code.\neventNative=[native code]\n\n# LOCALIZATION NOTE (*Events): The text to display in the events tab for\n# each group of sub-level event entries.\nanimationEvents=Animation\naudioEvents=Audio\nbatteryEvents=Battery\nclipboardEvents=Clipboard\ncompositionEvents=Composition\ndeviceEvents=Device\ndisplayEvents=Display\ndragAndDropEvents=Drag and Drop\ngamepadEvents=Gamepad\nindexedDBEvents=IndexedDB\ninteractionEvents=Interaction\nkeyboardEvents=Keyboard\nmediaEvents=HTML5 Media\nmouseEvents=Mouse\nmutationEvents=Mutation\nnavigationEvents=Navigation\npointerLockEvents=Pointer Lock\nsensorEvents=Sensor\nstorageEvents=Storage\ntimeEvents=Time\ntouchEvents=Touch\notherEvents=Other\n\n# LOCALIZATION NOTE (blackboxCheckboxTooltip2): The tooltip text to display when\n# the user hovers over the checkbox used to toggle blackboxing its associated\n# source.\nblackboxCheckboxTooltip2=Toggle blackboxing\n\n# LOCALIZATION NOTE (sources.search.key2): Key shortcut to open the search for\n# searching all the source files the debugger has seen.\nsources.search.key2=CmdOrCtrl+P\n\n# LOCALIZATION NOTE (sources.search.alt.key): A second key shortcut to open the\n# search for searching all the source files the debugger has seen.\nsources.search.alt.key=CmdOrCtrl+O\n\n# LOCALIZATION NOTE (projectTextSearch.key): A key shortcut to open the\n# full project text search for searching all the files the debugger has seen.\nprojectTextSearch.key=CmdOrCtrl+Shift+F\n\n# LOCALIZATION NOTE (functionSearch.key): A key shortcut to open the\n# modal for searching functions in a file.\nfunctionSearch.key=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE (toggleBreakpoint.key): A key shortcut to toggle\n# breakpoints.\ntoggleBreakpoint.key=CmdOrCtrl+B\n\n# LOCALIZATION NOTE (toggleCondPanel.key): A key shortcut to toggle\n# the conditional breakpoint panel.\ntoggleCondPanel.key=CmdOrCtrl+Shift+B\n\n# LOCALIZATION NOTE (stepOut.key): A key shortcut to\n# step out.\nstepOut.key=Shift+F11\n\n# LOCALIZATION NOTE (shortcuts.header.editor): Sections header in\n# the shortcuts modal for keyboard shortcuts related to editing.\nshortcuts.header.editor=Editor\n\n# LOCALIZATION NOTE (shortcuts.header.stepping): Sections header in\n# the shortcuts modal for keyboard shortcuts related to stepping.\nshortcuts.header.stepping=Stepping\n\n# LOCALIZATION NOTE (shortcuts.header.search): Sections header in\n# the shortcuts modal for keyboard shortcuts related to search.\nshortcuts.header.search=Search\n\n# LOCALIZATION NOTE (projectTextSearch.placeholder): A placeholder shown\n# when searching across all of the files in a project.\nprojectTextSearch.placeholder=Find in files…\n\n# LOCALIZATION NOTE (projectTextSearch.noResults): The center pane Text Search\n# message when the query did not match any text of all files in a project.\nprojectTextSearch.noResults=No results found\n\n# LOCALIZATION NOTE (sources.noSourcesAvailable): Text shown when the debugger\n# does not have any sources.\nsources.noSourcesAvailable=This page has no sources\n\n# LOCALIZATION NOTE (sourceSearch.search.key2): Key shortcut to open the search\n# for searching within a the currently opened files in the editor\nsourceSearch.search.key2=CmdOrCtrl+F\n\n# LOCALIZATION NOTE (sourceSearch.search.placeholder): placeholder text in\n# the source search input bar\nsourceSearch.search.placeholder=Search in file…\n\n# LOCALIZATION NOTE (sourceSearch.search.again.key2): Key shortcut to highlight\n# the next occurrence of the last search triggered from a source search\nsourceSearch.search.again.key2=CmdOrCtrl+G\n\n# LOCALIZATION NOTE (sourceSearch.search.againPrev.key2): Key shortcut to highlight\n# the previous occurrence of the last search triggered from a source search\nsourceSearch.search.againPrev.key2=CmdOrCtrl+Shift+G\n\n# LOCALIZATION NOTE (sourceSearch.resultsSummary1): Shows a summary of\n# the number of matches for autocomplete\nsourceSearch.resultsSummary1=%d results\n\n# LOCALIZATION NOTE (noMatchingStringsText): The text to display in the\n# global search results when there are no matching strings after filtering.\nnoMatchingStringsText=No matches found\n\n# LOCALIZATION NOTE (emptySearchText): This is the text that appears in the\n# filter text box when it is empty and the scripts container is selected.\nemptySearchText=Search scripts (%S)\n\n# LOCALIZATION NOTE (emptyVariablesFilterText): This is the text that\n# appears in the filter text box for the variables view container.\nemptyVariablesFilterText=Filter variables\n\n# LOCALIZATION NOTE (emptyPropertiesFilterText): This is the text that\n# appears in the filter text box for the editor's variables view bubble.\nemptyPropertiesFilterText=Filter properties\n\n# LOCALIZATION NOTE (searchPanelFilter): This is the text that appears in the\n# filter panel popup for the filter scripts operation.\nsearchPanelFilter=Filter scripts (%S)\n\n# LOCALIZATION NOTE (searchPanelGlobal): This is the text that appears in the\n# filter panel popup for the global search operation.\nsearchPanelGlobal=Search in all files (%S)\n\n# LOCALIZATION NOTE (searchPanelFunction): This is the text that appears in the\n# filter panel popup for the function search operation.\nsearchPanelFunction=Search for function definition (%S)\n\n# LOCALIZATION NOTE (searchPanelToken): This is the text that appears in the\n# filter panel popup for the token search operation.\nsearchPanelToken=Find in this file (%S)\n\n# LOCALIZATION NOTE (searchPanelGoToLine): This is the text that appears in the\n# filter panel popup for the line search operation.\nsearchPanelGoToLine=Go to line (%S)\n\n# LOCALIZATION NOTE (searchPanelVariable): This is the text that appears in the\n# filter panel popup for the variables search operation.\nsearchPanelVariable=Filter variables (%S)\n\n# LOCALIZATION NOTE (breakpointMenuItem): The text for all the elements that\n# are displayed in the breakpoints menu item popup.\nbreakpointMenuItem.setConditional=Configure conditional breakpoint\nbreakpointMenuItem.enableSelf2.label=Enable\nbreakpointMenuItem.enableSelf2.accesskey=E\nbreakpointMenuItem.disableSelf2.label=Disable\nbreakpointMenuItem.disableSelf2.accesskey=D\nbreakpointMenuItem.deleteSelf2.label=Remove\nbreakpointMenuItem.deleteSelf2.accesskey=R\nbreakpointMenuItem.enableOthers2.label=Enable others\nbreakpointMenuItem.enableOthers2.accesskey=o\nbreakpointMenuItem.disableOthers2.label=Disable others\nbreakpointMenuItem.disableOthers2.accesskey=s\nbreakpointMenuItem.deleteOthers2.label=Remove others\nbreakpointMenuItem.deleteOthers2.accesskey=h\nbreakpointMenuItem.enableAll2.label=Enable all\nbreakpointMenuItem.enableAll2.accesskey=b\nbreakpointMenuItem.disableAll2.label=Disable all\nbreakpointMenuItem.disableAll2.accesskey=k\nbreakpointMenuItem.deleteAll2.label=Remove all\nbreakpointMenuItem.deleteAll2.accesskey=a\nbreakpointMenuItem.removeCondition2.label=Remove condition\nbreakpointMenuItem.removeCondition2.accesskey=c\nbreakpointMenuItem.addCondition2.label=Add condition\nbreakpointMenuItem.addCondition2.accesskey=A\nbreakpointMenuItem.editCondition2.label=Edit condition\nbreakpointMenuItem.editCondition2.accesskey=n\nbreakpointMenuItem.enableSelf=Enable breakpoint\nbreakpointMenuItem.enableSelf.accesskey=E\nbreakpointMenuItem.disableSelf=Disable breakpoint\nbreakpointMenuItem.disableSelf.accesskey=D\nbreakpointMenuItem.deleteSelf=Remove breakpoint\nbreakpointMenuItem.deleteSelf.accesskey=R\nbreakpointMenuItem.enableOthers=Enable others\nbreakpointMenuItem.enableOthers.accesskey=o\nbreakpointMenuItem.disableOthers=Disable others\nbreakpointMenuItem.disableOthers.accesskey=s\nbreakpointMenuItem.deleteOthers=Remove others\nbreakpointMenuItem.deleteOthers.accesskey=h\nbreakpointMenuItem.enableAll=Enable all breakpoints\nbreakpointMenuItem.enableAll.accesskey=b\nbreakpointMenuItem.disableAll=Disable all breakpoints\nbreakpointMenuItem.disableAll.accesskey=k\nbreakpointMenuItem.deleteAll=Remove all breakpoints\nbreakpointMenuItem.deleteAll.accesskey=a\nbreakpointMenuItem.removeCondition.label=Remove breakpoint condition\nbreakpointMenuItem.removeCondition.accesskey=c\nbreakpointMenuItem.editCondition.label=Edit breakpoint condition\nbreakpointMenuItem.editCondition.accesskey=n\n\n# LOCALIZATION NOTE (breakpoints.header): Breakpoints right sidebar pane header.\nbreakpoints.header=Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.none): The text that appears when there are\n# no breakpoints present\nbreakpoints.none=No breakpoints\n\n# LOCALIZATION NOTE (breakpoints.enable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.enable=Enable breakpoints\n\n# LOCALIZATION NOTE (breakpoints.disable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.disable=Disable breakpoints\n\n# LOCALIZATION NOTE (breakpoints.removeBreakpointTooltip): The tooltip that is displayed\n# for remove breakpoint button in right sidebar\nbreakpoints.removeBreakpointTooltip=Remove breakpoint\n\n# LOCALIZATION NOTE (callStack.header): Call Stack right sidebar pane header.\ncallStack.header=Call stack\n\n# LOCALIZATION NOTE (callStack.notPaused): Call Stack right sidebar pane\n# message when not paused.\ncallStack.notPaused=Not paused\n\n# LOCALIZATION NOTE (callStack.collapse): Call Stack right sidebar pane\n# message to hide some of the frames that are shown.\ncallStack.collapse=Collapse rows\n\n# LOCALIZATION NOTE (callStack.expand): Call Stack right sidebar pane\n# message to show more of the frames.\ncallStack.expand=Expand rows\n\n# LOCALIZATION NOTE (editor.searchResults): Editor Search bar message\n# for the summarizing the selected search result. e.g. 5 of 10 results.\neditor.searchResults=%d of %d results\n\n# LOCALIZATION NOTE (sourceSearch.singleResult): Copy shown when there is one result.\neditor.singleResult=1 result\n\n# LOCALIZATION NOTE (editor.noResults): Editor Search bar message\n# for when no results found.\neditor.noResults=No results\n\n# LOCALIZATION NOTE (editor.searchResults.nextResult): Editor Search bar\n# tooltip for traversing to the Next Result\neditor.searchResults.nextResult=Next result\n\n# LOCALIZATION NOTE (editor.searchResults.prevResult): Editor Search bar\n# tooltip for traversing to the Previous Result\neditor.searchResults.prevResult=Previous result\n\n# LOCALIZATION NOTE (editor.searchTypeToggleTitle): Search bar title for\n# toggling search type buttons(function search, variable search)\neditor.searchTypeToggleTitle=Search for:\n\n# LOCALIZATION NOTE (editor.continueToHere.label): Editor gutter context\n# menu item for jumping to a new paused location\neditor.continueToHere.label=Continue to here\neditor.continueToHere.accesskey=H\n\n# LOCALIZATION NOTE (editor.addBreakpoint): Editor gutter context menu item\n# for adding a breakpoint on a line.\neditor.addBreakpoint=Add breakpoint\n\n# LOCALIZATION NOTE (editor.disableBreakpoint): Editor gutter context menu item\n# for disabling a breakpoint on a line.\neditor.disableBreakpoint=Disable breakpoint\n\n# LOCALIZATION NOTE (editor.enableBreakpoint): Editor gutter context menu item\n# for enabling a breakpoint on a line.\neditor.enableBreakpoint=Enable breakpoint\n\n# LOCALIZATION NOTE (editor.removeBreakpoint): Editor gutter context menu item\n# for removing a breakpoint on a line.\neditor.removeBreakpoint=Remove breakpoint\n\n# LOCALIZATION NOTE (editor.editBreakpoint): Editor gutter context menu item\n# for setting a breakpoint condition on a line.\neditor.editBreakpoint=Edit breakpoint\n\n# LOCALIZATION NOTE (editor.addConditionalBreakpoint): Editor gutter context\n# menu item for adding a breakpoint condition on a line.\neditor.addConditionalBreakpoint=Add conditional breakpoint\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Placeholder text for\n# input element inside ConditionalPanel component\neditor.conditionalPanel.placeholder=This breakpoint will pause when the expression is true\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Tooltip text for\n# close button inside ConditionalPanel component\neditor.conditionalPanel.close=Cancel edit breakpoint and close\n\n# LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item\n# for navigating to a source mapped location\neditor.jumpToMappedLocation1=Jump to %S location\n\n# LOCALIZATION NOTE (framework.disableGrouping): This is the text that appears in the\n# context menu to disable framework grouping.\nframework.disableGrouping=Disable framework grouping\nframework.disableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (framework.enableGrouping): This is the text that appears in the\n# context menu to enable framework grouping.\nframework.enableGrouping=Enable framework grouping\nframework.enableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (generated): Source Map term for a server source location\ngenerated=Generated\n\n# LOCALIZATION NOTE (original): Source Map term for a debugger UI source location\noriginal=original\n\n# LOCALIZATION NOTE (expressions.placeholder): Placeholder text for expression\n# input element\nexpressions.placeholder=Add watch expression\n\n# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item\n# for closing the selected tab below the mouse.\nsourceTabs.closeTab=Close tab\nsourceTabs.closeTab.accesskey=c\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs): Editor source tab context menu item\n# for closing the other tabs.\nsourceTabs.closeOtherTabs=Close other tabs\nsourceTabs.closeOtherTabs.accesskey=o\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd): Editor source tab context menu item\n# for closing the tabs to the end (the right for LTR languages) of the selected tab.\nsourceTabs.closeTabsToEnd=Close tabs to the right\nsourceTabs.closeTabsToEnd.accesskey=e\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs): Editor source tab context menu item\n# for closing all tabs.\nsourceTabs.closeAllTabs=Close all tabs\nsourceTabs.closeAllTabs.accesskey=a\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree): Editor source tab context menu item\n# for revealing source in tree.\nsourceTabs.revealInTree=Reveal in tree\nsourceTabs.revealInTree.accesskey=r\n\n# LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item\n# for copying a link address.\nsourceTabs.copyLink=Copy link address\nsourceTabs.copyLink.accesskey=l\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item\n# for pretty printing the source.\nsourceTabs.prettyPrint=Pretty print source\nsourceTabs.prettyPrint.accesskey=p\n\n# LOCALIZATION NOTE (sourceFooter.blackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.blackbox=Blackbox source\nsourceFooter.blackbox.accesskey=B\n\n# LOCALIZATION NOTE (sourceFooter.unblackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.unblackbox=Unblackbox source\nsourceFooter.unblackbox.accesskey=b\n\n# LOCALIZATION NOTE (sourceFooter.blackboxed): Text associated\n# with a blackboxed source\nsourceFooter.blackboxed=Blackboxed source\n\n# LOCALIZATION NOTE (sourceFooter.codeCoverage): Text associated\n# with a code coverage button\nsourceFooter.codeCoverage=Code coverage\n\n# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed\n# for close tab button in source tabs.\nsourceTabs.closeTabButtonTooltip=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.newTabButtonTooltip): The tooltip that is displayed for\n# new tab button in source tabs.\nsourceTabs.newTabButtonTooltip=Search for sources (%S)\n\n# LOCALIZATION NOTE (scopes.header): Scopes right sidebar pane header.\nscopes.header=Scopes\n\n# LOCALIZATION NOTE (scopes.notAvailable): Scopes right sidebar pane message\n# for when the debugger is paused, but there isn't pause data.\nscopes.notAvailable=Scopes unavailable\n\n# LOCALIZATION NOTE (scopes.notPaused): Scopes right sidebar pane message\n# for when the debugger is not paused.\nscopes.notPaused=Not paused\n\n# LOCALIZATION NOTE (scopes.block): Refers to a block of code in\n# the scopes pane when the debugger is paused.\nscopes.block=Block\n\n# LOCALIZATION NOTE (sources.header): Sources left sidebar header\nsources.header=Sources\n\n# LOCALIZATION NOTE (outline.header): Outline left sidebar header\noutline.header=Outline\n\n# LOCALIZATION NOTE (outline.noFunctions): Outline text when there are no functions to display\noutline.noFunctions=No functions\n\n# LOCALIZATION NOTE (sources.search): Sources left sidebar prompt\n# e.g. Cmd+P to search. On a mac, we use the command unicode character.\n# On windows, it's ctrl.\nsources.search=%S to search\n\n# LOCALIZATION NOTE (watchExpressions.header): Watch Expressions right sidebar\n# pane header.\nwatchExpressions.header=Watch expressions\n\n# LOCALIZATION NOTE (watchExpressions.refreshButton): Watch Expressions header\n# button for refreshing the expressions.\nwatchExpressions.refreshButton=Refresh\n\n# LOCALIZATION NOTE (welcome.search): The center pane welcome panel's\n# search prompt. e.g. cmd+p to search for files. On windows, it's ctrl, on\n# a mac we use the unicode character.\nwelcome.search=%S to search for sources\n\n# LOCALIZATION NOTE (welcome.findInFiles): The center pane welcome panel's\n# search prompt. e.g. cmd+f to search for files. On windows, it's ctrl+shift+f, on\n# a mac we use the unicode character.\nwelcome.findInFiles=%S to find in files\n\n# LOCALIZATION NOTE (welcome.searchFunction): Label displayed in the welcome\n# panel. %S is replaced by the keyboard shortcut to search for functions.\nwelcome.searchFunction=%S to search for functions in file\n\n# LOCALIZATION NOTE (sourceSearch.search): The center pane Source Search\n# prompt for searching for files.\nsourceSearch.search=Search sources…\n\n# LOCALIZATION NOTE (sourceSearch.noResults): The center pane Source Search\n# message when the query did not match any of the sources.\nsourceSearch.noResults2=No results found\n\n# LOCALIZATION NOTE (ignoreExceptions): The pause on exceptions button tooltip\n# when the debugger will not pause on exceptions.\nignoreExceptions=Ignore exceptions. Click to pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptions): The pause on exceptions button\n# tooltip when the debugger will pause on uncaught exceptions.\npauseOnUncaughtExceptions=Pause on uncaught exceptions. Click to pause on all exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptions): The pause on exceptions button tooltip\n# when the debugger will pause on all exceptions.\npauseOnExceptions=Pause on all exceptions. Click to ignore exceptions\n\n# LOCALIZATION NOTE (loadingText): The text that is displayed in the script\n# editor when the loading process has started but there is no file to display\n# yet.\nloadingText=Loading\\u2026\n\n# LOCALIZATION NOTE (errorLoadingText2): The text that is displayed in the debugger\n# viewer when there is an error loading a file\nerrorLoadingText2=Error loading this url: %S\n\n# LOCALIZATION NOTE (addWatchExpressionText): The text that is displayed in the\n# watch expressions list to add a new item.\naddWatchExpressionText=Add watch expression\n\n# LOCALIZATION NOTE (addWatchExpressionButton): The button that is displayed in the\n# variables view popup.\naddWatchExpressionButton=Watch\n\n# LOCALIZATION NOTE (emptyVariablesText): The text that is displayed in the\n# variables pane when there are no variables to display.\nemptyVariablesText=No variables to display\n\n# LOCALIZATION NOTE (scopeLabel): The text that is displayed in the variables\n# pane as a header for each variable scope (e.g. \"Global scope, \"With scope\",\n# etc.).\nscopeLabel=%S scope\n\n# LOCALIZATION NOTE (watchExpressionsScopeLabel): The name of the watch\n# expressions scope. This text is displayed in the variables pane as a header for\n# the watch expressions scope.\nwatchExpressionsScopeLabel=Watch expressions\n\n# LOCALIZATION NOTE (globalScopeLabel): The name of the global scope. This text\n# is added to scopeLabel and displayed in the variables pane as a header for\n# the global scope.\nglobalScopeLabel=Global\n\n# LOCALIZATION NOTE (variablesViewErrorStacktrace): This is the text that is\n# shown before the stack trace in an error.\nvariablesViewErrorStacktrace=Stack trace:\n\n# LOCALIZATION NOTE (variablesViewMoreObjects): the text that is displayed\n# when you have an object preview that does not show all of the elements. At the end of the list\n# you see \"N more...\" in the web console output.\n# This is a semi-colon list of plural forms.\n# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals\n# #1 number of remaining items in the object\n# example: 3 more…\nvariablesViewMoreObjects=#1 more…;#1 more…\n\n# LOCALIZATION NOTE (variablesEditableNameTooltip): The text that is displayed\n# in the variables list on an item with an editable name.\nvariablesEditableNameTooltip=Double click to edit\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in the variables list on an item with an editable value.\nvariablesEditableValueTooltip=Click to change value\n\n# LOCALIZATION NOTE (variablesCloseButtonTooltip): The text that is displayed\n# in the variables list on an item which can be removed.\nvariablesCloseButtonTooltip=Click to remove\n\n# LOCALIZATION NOTE (variablesEditButtonTooltip): The text that is displayed\n# in the variables list on a getter or setter which can be edited.\nvariablesEditButtonTooltip=Click to set value\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in a tooltip on the \"open in inspector\" button in the the variables list for a\n# DOMNode item.\nvariablesDomNodeValueTooltip=Click to select the node in the inspector\n\n# LOCALIZATION NOTE (configurable|...|Tooltip): The text that is displayed\n# in the variables list on certain variables or properties as tooltips.\n# Expanations of what these represent can be found at the following links:\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed\n# It's probably best to keep these in English.\nconfigurableTooltip=configurable\nenumerableTooltip=enumerable\nwritableTooltip=writable\nfrozenTooltip=frozen\nsealedTooltip=sealed\nextensibleTooltip=extensible\noverriddenTooltip=overridden\nWebIDLTooltip=WebIDL\n\n# LOCALIZATION NOTE (variablesSeparatorLabel): The text that is displayed\n# in the variables list as a separator between the name and value.\nvariablesSeparatorLabel=:\n\n# LOCALIZATION NOTE (watchExpressionsSeparatorLabel2): The text that is displayed\n# in the watch expressions list as a separator between the code and evaluation.\nwatchExpressionsSeparatorLabel2=\\u0020→\n\n# LOCALIZATION NOTE (functionSearchSeparatorLabel): The text that is displayed\n# in the functions search panel as a separator between function's inferred name\n# and its real name (if available).\nfunctionSearchSeparatorLabel=←\n\n# LOCALIZATION NOTE(symbolSearch.search.functionsPlaceholder): The placeholder\n# text displayed when the user searches for functions in a file\nsymbolSearch.search.functionsPlaceholder=Search functions…\n\n# LOCALIZATION NOTE(symbolSearch.search.variablesPlaceholder): The placeholder\n# text displayed when the user searches for variables in a file\nsymbolSearch.search.variablesPlaceholder=Search variables…\n\n# LOCALIZATION NOTE(symbolSearch.search.key2): The Key Shortcut for\n# searching for a function or variable\nsymbolSearch.search.key2=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.modifiersLabel): A label\n# preceding the group of modifiers\nsymbolSearch.searchModifier.modifiersLabel=Modifiers:\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.regex): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.regex=Regex\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.caseSensitive): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.caseSensitive=Case sensitive\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.wholeWord): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.wholeWord=Whole word\n\n# LOCALIZATION NOTE (resumptionOrderPanelTitle): This is the text that appears\n# as a description in the notification panel popup, when multiple debuggers are\n# open in separate tabs and the user tries to resume them in the wrong order.\n# The substitution parameter is the URL of the last paused window that must be\n# resumed first.\nresumptionOrderPanelTitle=There are one or more paused debuggers. Please resume the most-recently paused debugger first at: %S\n\nvariablesViewOptimizedOut=(optimized away)\nvariablesViewUninitialized=(uninitialized)\nvariablesViewMissingArgs=(unavailable)\n\nanonymousSourcesLabel=Anonymous sources\n\nexperimental=This is an experimental feature\n\n# LOCALIZATION NOTE (whyPaused.debuggerStatement): The text that is displayed\n# in a info block explaining how the debugger is currently paused due to a `debugger`\n# statement in the code\nwhyPaused.debuggerStatement=Paused on debugger statement\n\n# LOCALIZATION NOTE (whyPaused.breakpoint): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a breakpoint\nwhyPaused.breakpoint=Paused on breakpoint\n\n# LOCALIZATION NOTE (whyPaused.exception): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an exception\nwhyPaused.exception=Paused on exception\n\n# LOCALIZATION NOTE (whyPaused.resumeLimit): The text that is displayed\n# in a info block explaining how the debugger is currently paused while stepping\n# in or out of the stack\nwhyPaused.resumeLimit=Paused while stepping\n\n# LOCALIZATION NOTE (whyPaused.pauseOnDOMEvents): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# dom event\nwhyPaused.pauseOnDOMEvents=Paused on event listener\n\n# LOCALIZATION NOTE (whyPaused.breakpointConditionThrown): The text that is displayed\n# in an info block when evaluating a conditional breakpoint throws an error\nwhyPaused.breakpointConditionThrown=Error with conditional breakpoint\n\n# LOCALIZATION NOTE (whyPaused.xhr): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# xml http request\nwhyPaused.xhr=Paused on XMLHttpRequest\n\n# LOCALIZATION NOTE (whyPaused.promiseRejection): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# promise rejection\nwhyPaused.promiseRejection=Paused on promise rejection\n\n# LOCALIZATION NOTE (whyPaused.assert): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# assert\nwhyPaused.assert=Paused on assertion\n\n# LOCALIZATION NOTE (whyPaused.debugCommand): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# debugger statement\nwhyPaused.debugCommand=Paused on debugged function\n\n# LOCALIZATION NOTE (whyPaused.other): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an event\n# listener breakpoint set\nwhyPaused.other=Debugger paused\n\n# LOCALIZATION NOTE (ctrl): The text that is used for documenting\n# keyboard shortcuts that use the control key\nctrl=Ctrl\n\n# LOCALIZATION NOTE (anonymous): The text that is displayed when the\n# display name is null.\nanonymous=(anonymous)\n\n# LOCALIZATION NOTE (shortcuts.toggleBreakpoint): text describing\n# keyboard shortcut action for toggling breakpoint\nshortcuts.toggleBreakpoint=Toggle Breakpoint\n\n# LOCALIZATION NOTE (shortcuts.toggleCondPanel): text describing\n# keyboard shortcut action for toggling conditional panel keyboard\nshortcuts.toggleCondPanel=Toggle Conditional Panel\n\n# LOCALIZATION NOTE (shortcuts.pauseOrResume): text describing\n# keyboard shortcut action for pause of resume\nshortcuts.pauseOrResume=Pause/Resume\n\n# LOCALIZATION NOTE (shortcuts.stepOver): text describing\n# keyboard shortcut action for stepping over\nshortcuts.stepOver=Step Over\n\n# LOCALIZATION NOTE (shortcuts.stepIn): text describing\n# keyboard shortcut action for stepping in\nshortcuts.stepIn=Step In\n\n# LOCALIZATION NOTE (shortcuts.stepOut): text describing\n# keyboard shortcut action for stepping out\nshortcuts.stepOut=Step Out\n\n# LOCALIZATION NOTE (shortcuts.fileSearch): text describing\n# keyboard shortcut action for source file search\nshortcuts.fileSearch=Source File Search\n\n# LOCALIZATION NOTE (shortcuts.searchAgain): text describing\n# keyboard shortcut action for searching again\nshortcuts.searchAgain=Search Again\n\n# LOCALIZATION NOTE (shortcuts.projectSearch): text describing\n# keyboard shortcut action for full project search\nshortcuts.projectSearch=Full Project Search\n\n# LOCALIZATION NOTE (shortcuts.functionSearch): text describing\n# keyboard shortcut action for function search\nshortcuts.functionSearch=Function Search\n" /***/ }), /* 961 */, @@ -40945,8 +40937,6 @@ Frames.propTypes = { pause: _react.PropTypes.object }; -Frames.displayName = "Frames"; - function getSourceForFrame(sources, frame) { return (0, _selectors.getSourceInSources)(sources, frame.location.sourceId); } @@ -41021,8 +41011,6 @@ function FrameTitle(_ref) { ); } -FrameTitle.displayName = "FrameTitle"; - function FrameLocation(_ref2) { var frame = _ref2.frame; @@ -41690,10 +41678,6 @@ class HighlightLines extends _react.Component { return null; } } - - -HighlightLines.displayName = "HighlightLines"; - exports.default = HighlightLines; /***/ }), @@ -41734,8 +41718,6 @@ var BracketArrow = (_ref) => { }); }; -BracketArrow.displayName = "BracketArrow"; - exports.default = BracketArrow; /***/ }), @@ -41870,7 +41852,7 @@ module.exports = " ({ sources: (0, _selectors.getSources)(state), activeSearch: (0, _selectors.getActiveSearch)(state), @@ -44027,8 +43982,6 @@ SourceSearch.contextTypes = { shortcuts: _react.PropTypes.object }; -SourceSearch.displayName = "SourceSearch"; - /***/ }), /* 1142 */ /***/ (function(module, exports, __webpack_require__) { @@ -44082,7 +44035,7 @@ class PrimaryPanes extends _react.Component { this.renderShortcut = this.renderShortcut.bind(this); this.showPane = this.showPane.bind(this); - this.renderFooter = this.renderFooter.bind(this); + this.renderTabs = this.renderTabs.bind(this); } showPane(selectedPane) { @@ -44121,10 +44074,10 @@ class PrimaryPanes extends _react.Component { )]; } - renderFooter() { + renderTabs() { return _react2.default.createElement( "div", - { className: "source-footer" }, + { className: "source-outline-tabs" }, this.renderOutlineTabs() ); } @@ -44145,43 +44098,36 @@ class PrimaryPanes extends _react.Component { } } - renderHeader() { - return _react2.default.createElement( - "div", - { className: "sources-header" }, - this.renderShortcut() - ); + renderOutline() { + var selectSource = this.props.selectSource; + + + var outlineComp = (0, _devtoolsConfig.isEnabled)("outline") ? _react2.default.createElement(_Outline2.default, { selectSource: selectSource }) : null; + + return outlineComp; } - render() { - var selectedPane = this.state.selectedPane; + renderSources() { var _props = this.props, sources = _props.sources, selectSource = _props.selectSource; + return _react2.default.createElement(_SourcesTree2.default, { sources: sources, selectSource: selectSource }); + } + + render() { + var selectedPane = this.state.selectedPane; - var outlineComp = (0, _devtoolsConfig.isEnabled)("outline") ? _react2.default.createElement(_Outline2.default, { - selectSource: selectSource, - isHidden: selectedPane === "sources" - }) : null; return _react2.default.createElement( "div", { className: "sources-panel" }, - this.renderHeader(), - _react2.default.createElement(_SourcesTree2.default, { - sources: sources, - selectSource: selectSource, - isHidden: selectedPane === "outline" - }), - outlineComp, - this.renderFooter() + this.renderTabs(), + selectedPane === "sources" ? this.renderSources() : this.renderOutline() ); } } -PrimaryPanes.displayName = "PrimaryPanes"; - exports.default = (0, _reactRedux.connect)(state => ({ sources: (0, _selectors.getSources)(state), sourceSearchOn: (0, _selectors.getActiveSearch)(state) === "source" @@ -44203,8 +44149,6 @@ var _promise = __webpack_require__(193); var _ast = __webpack_require__(1059); -var _source = __webpack_require__(233); - function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /** @@ -44220,7 +44164,7 @@ function loadSourceText(source) { sourceMaps = _ref2.sourceMaps; // Fetch the source text only once. - if ((0, _source.isLoaded)(source)) { + if (source.text) { return Promise.resolve(source); } @@ -44307,10 +44251,6 @@ var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(151); -var _classnames = __webpack_require__(175); - -var _classnames2 = _interopRequireDefault(_classnames); - var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); @@ -44374,24 +44314,20 @@ class Outline extends _react.Component { } render() { - var _props2 = this.props, - isHidden = _props2.isHidden, - symbols = _props2.symbols; + var symbols = this.props.symbols; var symbolsToDisplay = symbols.functions.filter(func => func.name != "anonymous"); return _react2.default.createElement( "div", - { className: (0, _classnames2.default)("outline", { hidden: isHidden }) }, + { className: "outline" }, symbolsToDisplay.length > 0 ? this.renderFunctions(symbolsToDisplay) : this.renderPlaceholder() ); } } exports.Outline = Outline; -Outline.displayName = "Outline"; - exports.default = (0, _reactRedux.connect)(state => { var selectedSource = (0, _selectors.getSelectedSource)(state); return { @@ -44470,8 +44406,6 @@ class EmptyLines extends _react.Component { } } -EmptyLines.displayName = "EmptyLines"; - exports.default = (0, _reactRedux.connect)(state => { var selectedSource = (0, _selectors.getSelectedSource)(state); return { @@ -44539,7 +44473,6 @@ class SourcesTree extends _react.Component { constructor(props) { super(props); this.state = (0, _sourcesTree.createTree)(this.props.sources, this.props.debuggeeUrl); - this.focusItem = this.focusItem.bind(this); this.selectItem = this.selectItem.bind(this); this.getIcon = this.getIcon.bind(this); @@ -44641,6 +44574,10 @@ class SourcesTree extends _react.Component { } getIcon(item, depth) { + if (item.path === "/webpack://") { + return _react2.default.createElement(_Svg2.default, { name: "webpack" }); + } + if (depth === 0) { return _react2.default.createElement(_Svg2.default, { name: "domain" }); } @@ -44710,18 +44647,22 @@ class SourcesTree extends _react.Component { }, onContextMenu: e => this.onContextMenu(e, item) }, + arrow, + icon, _react2.default.createElement( - "div", - null, - arrow, - icon, - item.name + "span", + { className: "label" }, + " ", + item.name, + " " ) ); } render() { - var isHidden = this.props.isHidden; + var _props = this.props, + setExpandedState = _props.setExpandedState, + expanded = _props.expanded; var _state = this.state, focusedItem = _state.focusedItem, sourceTree = _state.sourceTree, @@ -44731,7 +44672,6 @@ class SourcesTree extends _react.Component { var isEmpty = sourceTree.contents.length === 0; - var treeProps = { key: isEmpty ? "empty" : "full", getParent: item => parentMap.get(item), @@ -44739,11 +44679,14 @@ class SourcesTree extends _react.Component { getRoots: () => sourceTree.contents, getPath: item => `${item.path}/${item.name}`, itemHeight: 21, - autoExpandDepth: 1, + autoExpandDepth: expanded ? 0 : 1, autoExpandAll: false, onFocus: this.focusItem, listItems, highlightItems, + expanded, + onExpand: (item, expandedState) => setExpandedState(expandedState), + onCollapse: (item, expandedState) => setExpandedState(expandedState), renderItem: this.renderItem }; @@ -44765,31 +44708,28 @@ class SourcesTree extends _react.Component { return _react2.default.createElement( "div", - { - className: (0, _classnames2.default)("sources-list", { hidden: isHidden }), - onKeyDown: onKeyDown - }, + { className: "sources-list", onKeyDown: onKeyDown }, tree ); } } SourcesTree.propTypes = { - isHidden: _react.PropTypes.bool, sources: _reactImmutableProptypes2.default.map.isRequired, selectSource: _react.PropTypes.func.isRequired, shownSource: _react.PropTypes.string, selectedSource: _reactImmutableProptypes2.default.map, - debuggeeUrl: _react.PropTypes.string.isRequired + debuggeeUrl: _react.PropTypes.string.isRequired, + setExpandedState: _react.PropTypes.func, + expanded: _react.PropTypes.any }; -SourcesTree.displayName = "SourcesTree"; - exports.default = (0, _reactRedux.connect)(state => { return { shownSource: (0, _selectors.getShownSource)(state), selectedSource: (0, _selectors.getSelectedSource)(state), - debuggeeUrl: (0, _selectors.getDebuggeeUrl)(state) + debuggeeUrl: (0, _selectors.getDebuggeeUrl)(state), + expanded: (0, _selectors.getExpandedState)(state) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SourcesTree); @@ -44813,19 +44753,26 @@ __webpack_require__(1162); var _reactRedux = __webpack_require__(151); +var _selectors = __webpack_require__(242); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Workers extends _react.PureComponent { + renderWorkers(workers) { return workers.map(w => _react2.default.createElement( "div", - null, - w + { className: "worker", key: w.url }, + w.url )); } renderNoWorkersPlaceholder() { - return L10N.getStr("noWorkersText"); + return _react2.default.createElement( + "div", + { className: "pane-info" }, + L10N.getStr("noWorkersText") + ); } render() { @@ -44833,24 +44780,15 @@ class Workers extends _react.PureComponent { return _react2.default.createElement( "div", - { className: "pane" }, - _react2.default.createElement( - "div", - { className: "pane-info" }, - workers && workers.length > 0 ? this.renderWorkers(workers) : this.renderNoWorkersPlaceholder() - ) + { className: "pane workers-list" }, + workers && workers.size > 0 ? this.renderWorkers(workers) : this.renderNoWorkersPlaceholder() ); } } exports.Workers = Workers; -Workers.displayName = "Workers"; -Workers.propTypes = { - workers: _react.PropTypes.array.isRequired -}; - function mapStateToProps(state) { - return { workers: [] }; + return { workers: (0, _selectors.getWorkers)(state) }; } exports.default = (0, _reactRedux.connect)(mapStateToProps)(Workers); @@ -45859,8 +45797,6 @@ class Breakpoints extends _react.Component { } } -Breakpoints.displayName = "Breakpoints"; - exports.default = (0, _reactRedux.connect)(state => ({ breakpoints: (0, _visibleBreakpoints2.default)(state), selectedSource: (0, _selectors.getSelectedSource)(state) @@ -46054,7 +45990,6 @@ class CallSites extends _react.Component { } } -CallSites.displayName = "CallSites"; function getCallSites(symbols, breakpoints) { if (!symbols || !symbols.callExpressions) { return; @@ -46268,9 +46203,7 @@ class CallSite extends _react.Component { return null; } } - exports.default = CallSite; -CallSite.displayName = "CallSite"; /***/ }), /* 1168 */ @@ -46742,7 +46675,6 @@ class SymbolModal extends _react.Component { } } -SymbolModal.displayName = "SymbolModal"; SymbolModal.contextTypes = { shortcuts: _react.PropTypes.object }; @@ -46773,13 +46705,613 @@ exports.default = (0, _reactRedux.connect)(state => { /***/ }), /* 1171 */, -/* 1172 */, +/* 1172 */ +/***/ (function(module, exports, __webpack_require__) { + +/* 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/. */ + +const md5 = __webpack_require__(248); + +function originalToGeneratedId(originalId) { + const match = originalId.match(/(.*)\/originalSource/); + return match ? match[1] : ""; +} + +function generatedToOriginalId(generatedId, url) { + return `${generatedId}/originalSource-${md5(url)}`; +} + +function isOriginalId(id) { + return !!id.match(/\/originalSource/); +} + +function isGeneratedId(id) { + return !isOriginalId(id); +} + +/** + * Trims the query part or reference identifier of a URL string, if necessary. + */ +function trimUrlQuery(url) { + let length = url.length; + let q1 = url.indexOf("?"); + let q2 = url.indexOf("&"); + let q3 = url.indexOf("#"); + let q = Math.min(q1 != -1 ? q1 : length, q2 != -1 ? q2 : length, q3 != -1 ? q3 : length); + + return url.slice(0, q); +} + +// Map suffix to content type. +const contentMap = { + "js": "text/javascript", + "jsm": "text/javascript", + "ts": "text/typescript", + "tsx": "text/typescript-jsx", + "jsx": "text/jsx", + "coffee": "text/coffeescript", + "elm": "text/elm", + "cljs": "text/x-clojure" +}; + +/** + * Returns the content type for the specified URL. If no specific + * content type can be determined, "text/plain" is returned. + * + * @return String + * The content type. + */ +function getContentType(url) { + url = trimUrlQuery(url); + let dot = url.lastIndexOf("."); + if (dot >= 0) { + let name = url.substring(dot + 1); + if (name in contentMap) { + return contentMap[name]; + } + } + return "text/plain"; +} + +module.exports = { + originalToGeneratedId, + generatedToOriginalId, + isOriginalId, + isGeneratedId, + getContentType, + contentMapForTesting: contentMap +}; + +/***/ }), /* 1173 */, /* 1174 */ /***/ (function(module, exports) { module.exports = "image/svg+xml" +/***/ }), +/* 1175 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getWorkers = exports.State = undefined; +exports.default = debuggee; + +var _reselect = __webpack_require__(993); + +var _immutable = __webpack_require__(146); + +var _makeRecord = __webpack_require__(230); + +var _makeRecord2 = _interopRequireDefault(_makeRecord); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var State = exports.State = (0, _makeRecord2.default)({ + workers: (0, _immutable.List)() +}); + +function debuggee() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : State(); + var action = arguments[1]; + + switch (action.type) { + case "SET_WORKERS": + return state.set("workers", (0, _immutable.List)(action.workers.workers)); + default: + return state; + } +} + +var getDebuggeeWrapper = state => state.debuggee; + +var getWorkers = exports.getWorkers = (0, _reselect.createSelector)(getDebuggeeWrapper, debuggeeState => debuggeeState.get("workers")); + +/***/ }), +/* 1176 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.InitialState = InitialState; +exports.default = update; +exports.getExpandedState = getExpandedState; + +var _makeRecord = __webpack_require__(230); + +var _makeRecord2 = _interopRequireDefault(_makeRecord); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function InitialState() { + return (0, _makeRecord2.default)({ + expanded: null + })(); +} +/* 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/. */ + +/** + * Source tree reducer + * @module reducers/source-tree + */ +function update() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : InitialState(); + var action = arguments[1]; + + switch (action.type) { + case "SET_EXPANDED_STATE": + return state.set("expanded", action.expanded); + } + return state; +} + +function getExpandedState(state) { + return state.sourceTree.get("expanded"); +} + +/***/ }), +/* 1177 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sanitizeInput = sanitizeInput; +exports.wrapExpression = wrapExpression; +exports.getValue = getValue; + + +// replace quotes and slashes that could interfere with the evaluation. +function sanitizeInput(input) { + return input.replace(/\\/g, "\\\\").replace(/"/g, "\\$&"); +} + +/* + * wrap the expression input in a try/catch so that it can be safely + * evaluated. + * + * NOTE: we add line after the expression to protect against comments. +*/ + + +function wrapExpression(input) { + return `eval(\` + try { + ${sanitizeInput(input)} + } catch (e) { + e + } + \`)`.trim(); +} + +function getValue(expression) { + var value = expression.value; + if (!value) { + return { + path: expression.from, + value: { unavailable: true } + }; + } + + if (value.exception) { + return { + path: value.from, + value: value.exception + }; + } + + if (value.error) { + return { + path: value.from, + value: value.error + }; + } + + if (value.result && value.result.class == "Error") { + var _value$result$preview = value.result.preview, + name = _value$result$preview.name, + message = _value$result$preview.message; + + var newValue = name === "ReferenceError" ? { unavailable: true } : `${name}: ${message}`; + + return { path: value.input, value: newValue }; + } + + if (typeof value.result == "object") { + return { + path: value.result.actor, + value: value.result + }; + } + + return { + path: value.input, + value: value.result + }; +} + +/***/ }), +/* 1178 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setExpandedState = setExpandedState; +function setExpandedState(expanded) { + return (_ref) => { + var dispatch = _ref.dispatch, + getState = _ref.getState; + + dispatch({ + type: "SET_EXPANDED_STATE", + expanded + }); + }; +} + +/***/ }), +/* 1179 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setWorkers = setWorkers; +function setWorkers(workers) { + return { + type: "SET_WORKERS", + workers + }; +} + +/***/ }), +/* 1180 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.openLink = openLink; + +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + +/* 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/. */ +var _require = __webpack_require__(828), + isDevelopment = _require.isDevelopment; + +/** + * @memberof actions/toolbox + * @static + */ +function openLink(url) { + return (() => { + var _ref = _asyncToGenerator(function* (_ref2) { + var openLinkCommand = _ref2.openLink; + + if (isDevelopment()) { + var win = window.open(url, "_blank"); + win.focus(); + } else { + openLinkCommand(url); + } + }); + + return function (_x) { + return _ref.apply(this, arguments); + }; + })(); +} + +/***/ }), +/* 1181 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ShortcutsModal = undefined; + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _Modal = __webpack_require__(332); + +var _Modal2 = _interopRequireDefault(_Modal); + +var _text = __webpack_require__(389); + +__webpack_require__(1182); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class ShortcutsModal extends _react.Component { + + renderShorcutItem(title, combo) { + return _react2.default.createElement( + "li", + null, + _react2.default.createElement( + "span", + null, + title + ), + _react2.default.createElement( + "span", + null, + combo + ) + ); + } + + renderEditorShortcuts() { + return _react2.default.createElement( + "ul", + { className: "shortcuts-list" }, + this.renderShorcutItem(L10N.getStr("shortcuts.toggleBreakpoint"), (0, _text.formatKeyShortcut)(L10N.getStr("toggleBreakpoint.key"))), + this.renderShorcutItem(L10N.getStr("shortcuts.toggleCondPanel"), (0, _text.formatKeyShortcut)(L10N.getStr("toggleCondPanel.key"))) + ); + } + + renderSteppingShortcuts() { + return _react2.default.createElement( + "ul", + { className: "shortcuts-list" }, + this.renderShorcutItem(L10N.getStr("shortcuts.pauseOrResume"), "F8"), + this.renderShorcutItem(L10N.getStr("shortcuts.stepOver"), "F10"), + this.renderShorcutItem(L10N.getStr("shortcuts.stepIn"), "F11"), + this.renderShorcutItem(L10N.getStr("shortcuts.stepOut"), (0, _text.formatKeyShortcut)(L10N.getStr("stepOut.key"))) + ); + } + + renderSearchShortcuts() { + return _react2.default.createElement( + "ul", + { className: "shortcuts-list" }, + this.renderShorcutItem(L10N.getStr("shortcuts.fileSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"))), + this.renderShorcutItem(L10N.getStr("shortcuts.searchAgain"), (0, _text.formatKeyShortcut)(L10N.getStr("sourceSearch.search.again.key2"))), + this.renderShorcutItem(L10N.getStr("shortcuts.projectSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("projectTextSearch.key"))), + this.renderShorcutItem(L10N.getStr("shortcuts.functionSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("functionSearch.key"))) + ); + } + + renderShortcutsContent() { + return _react2.default.createElement( + "div", + { className: "shortcuts-content" }, + _react2.default.createElement( + "h2", + null, + L10N.getStr("shortcuts.header.editor") + ), + _react2.default.createElement( + "div", + { className: "shortcuts-section" }, + this.renderEditorShortcuts() + ), + _react2.default.createElement( + "h2", + null, + L10N.getStr("shortcuts.header.stepping") + ), + _react2.default.createElement( + "div", + { className: "shortcuts-section" }, + this.renderSteppingShortcuts() + ), + _react2.default.createElement( + "h2", + null, + L10N.getStr("shortcuts.header.search") + ), + _react2.default.createElement( + "div", + { className: "shortcuts-section" }, + this.renderSearchShortcuts() + ) + ); + } + + render() { + var enabled = this.props.enabled; + + + if (!enabled) { + return null; + } + + return _react2.default.createElement( + _Modal2.default, + { + "in": enabled, + additionalClass: "shortcuts-modal", + handleClose: this.props.handleClose + }, + this.renderShortcutsContent() + ); + } +} + +exports.ShortcutsModal = ShortcutsModal; +ShortcutsModal.displayName = "ShortcutsModal"; + +/***/ }), +/* 1182 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 1183 */ +/***/ (function(module, exports) { + +module.exports = "" + +/***/ }), +/* 1184 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.highlightMatches = highlightMatches; + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function highlightMatches(lineMatch) { + var value = lineMatch.value, + column = lineMatch.column, + match = lineMatch.match; + + var len = match.length; + + return _react2.default.createElement( + "span", + { className: "line-value" }, + _react2.default.createElement( + "span", + { className: "line-match", key: 0 }, + value.slice(0, column) + ), + _react2.default.createElement( + "span", + { className: "query-match", key: 1 }, + value.substr(column, len) + ), + _react2.default.createElement( + "span", + { className: "line-match", key: 2 }, + value.slice(column + len, value.length) + ) + ); +} // Maybe reuse file search's functions? + +/***/ }), +/* 1185 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _classnames = __webpack_require__(175); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _Svg = __webpack_require__(344); + +var _Svg2 = _interopRequireDefault(_Svg); + +__webpack_require__(918); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function debugBtn(onClick, type, className, tooltip) { + var disabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + var props = { + onClick, + key: type, + "aria-label": tooltip, + title: tooltip, + disabled + }; + + return _react2.default.createElement( + "button", + _extends({ className: (0, _classnames2.default)(type, className) }, props), + _react2.default.createElement(_Svg2.default, { name: type }) + ); +} + +class UtilsBar extends _react.Component { + + renderUtilButtons() { + return [debugBtn(this.props.toggleShortcutsModal, "shortcut", "active", "shortcuts", false)]; + } + + render() { + return _react2.default.createElement( + "div", + { + className: (0, _classnames2.default)("command-bar bottom", { + vertical: !this.props.horizontal + }) + }, + this.renderUtilButtons() + ); + } +} + +exports.default = UtilsBar; + /***/ }) /******/ ]); -}); +}); \ No newline at end of file diff --git a/devtools/client/debugger/new/panel.js b/devtools/client/debugger/new/panel.js index 5e369944c28c..1ec20834b95b 100644 --- a/devtools/client/debugger/new/panel.js +++ b/devtools/client/debugger/new/panel.js @@ -31,11 +31,11 @@ DebuggerPanel.prototype = { tabTarget: this.toolbox.target, debuggerClient: this.toolbox.target.client, sourceMaps: this.toolbox.sourceMapService, - // Open a link in a new browser tab. toolboxActions: { + // Open a link in a new browser tab. openLink: this.openLink.bind(this) } - }) + }); this._actions = actions; this._store = store; diff --git a/devtools/client/debugger/new/parser-worker.js b/devtools/client/debugger/new/parser-worker.js index 0205e03b8626..b102a57ad35e 100644 --- a/devtools/client/debugger/new/parser-worker.js +++ b/devtools/client/debugger/new/parser-worker.js @@ -28903,6 +28903,10 @@ var _getSymbols2 = _interopRequireDefault(_getSymbols); var _ast = __webpack_require__(1051); +var _getScopes = __webpack_require__(1186); + +var _getScopes2 = _interopRequireDefault(_getScopes); + var _sources = __webpack_require__(1171); var _getOutOfScopeLocations = __webpack_require__(1072); @@ -28926,7 +28930,9 @@ self.onmessage = workerHandler({ getClosestExpression: _closest.getClosestExpression, getOutOfScopeLocations: _getOutOfScopeLocations2.default, getSymbols: _getSymbols2.default, + getScopes: _getScopes2.default, clearSymbols: _getSymbols.clearSymbols, + clearScopes: _getScopes.clearScopes, clearASTs: _ast.clearASTs, hasSource: _sources.hasSource, setSource: _sources.setSource, @@ -29397,6 +29403,15 @@ function getComments(ast) { })); } +function getClassName(path) { + var classDeclaration = path.findParent(_p => _p.isClassDeclaration()); + if (!classDeclaration) { + return null; + } + + return classDeclaration.node.id.name; +} + function extractSymbols(source) { var functions = []; var variables = []; @@ -29414,6 +29429,7 @@ function extractSymbols(source) { if ((0, _helpers.isFunction)(path)) { functions.push({ name: (0, _getFunctionName2.default)(path), + klass: getClassName(path), location: path.node.loc, parameterNames: getFunctionParameterNames(path), identifier: path.node.id @@ -29671,12 +29687,7 @@ function getSnippet(path, prevPath) { } function formatSymbols(source) { - var _getSymbols = getSymbols(source), - objectProperties = _getSymbols.objectProperties, - memberExpressions = _getSymbols.memberExpressions, - callExpressions = _getSymbols.callExpressions, - identifiers = _getSymbols.identifiers, - variables = _getSymbols.variables; + var symbols = getSymbols(source); function formatLocation(loc) { if (!loc) { @@ -29696,10 +29707,11 @@ function formatSymbols(source) { var exprLoc = formatLocation(symbol.expressionLocation); var params = symbol.parameterNames ? symbol.parameterNames.join(", ") : ""; var expression = symbol.expression || ""; - return `${loc} ${exprLoc} ${expression} ${symbol.name} ${params}`; + var klass = symbol.klass || ""; + return `${loc} ${exprLoc} ${expression} ${symbol.name} ${params} ${klass}`; } - return ["properties", objectProperties.map(summarize).join("\n"), "member expressions", memberExpressions.map(summarize).join("\n"), "call expressions", callExpressions.map(summarize).join("\n"), "identifiers", identifiers.map(summarize).join("\n"), "variables", variables.map(summarize).join("\n")].join("\n"); + return Object.keys(symbols).map(name => `${name}:\n ${symbols[name].map(summarize).join("\n")}`); } function clearSymbols() { @@ -33056,6 +33068,301 @@ function clearSources() { cachedSources = new Map(); } +/***/ }), +/* 1172 */, +/* 1173 */, +/* 1174 */, +/* 1175 */, +/* 1176 */, +/* 1177 */, +/* 1178 */, +/* 1179 */, +/* 1180 */, +/* 1181 */, +/* 1182 */, +/* 1183 */, +/* 1184 */, +/* 1185 */, +/* 1186 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = getScopes; +exports.clearScopes = clearScopes; + +var _ast = __webpack_require__(1051); + +var _sources = __webpack_require__(1171); + +var _parser = __webpack_require__(1187); + +var parsedScopesCache = new Map(); + +function getScopes(location) { + var sourceId = location.sourceId; + + var parsedScopes = parsedScopesCache.get(sourceId); + if (!parsedScopes) { + var visitor = (0, _parser.createParseJSScopeVisitor)(sourceId); + (0, _ast.traverseAst)((0, _sources.getSource)(sourceId), visitor.traverseVisitor); + parsedScopes = visitor.toParsedScopes(); + parsedScopesCache.set(sourceId, parsedScopes); + } + return (0, _parser.findScopes)(parsedScopes, location); +} + +function clearScopes() { + parsedScopesCache = new Map(); +} + +/***/ }), +/* 1187 */ +/***/ (function(module, exports) { + +/* 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/. */ + +function createTempScope(type, parent, loc) { + const result = { + type, + parent, + children: [], + loc: loc, + names: Object.create(null) + }; + if (parent) { + parent.children.push(result); + } + return result; +} + +function isNode(node, type) { + return node ? node.type === type : false; +} + +function getFunctionScope(scope) { + let s = scope; + while (s.type !== "Function" && s.type !== "Script") { + if (!s.parent) { + return s; + } + s = s.parent; + } + return s; +} + +function fromBabelLocation(location, sourceId) { + return { + sourceId, + line: location.line, + column: location.column + }; +} + +function parseDeclarator(declaratorId, targetScope, type) { + if (isNode(declaratorId, "Identifier")) { + targetScope.names[declaratorId.name] = { type, refs: [] }; + } else if (isNode(declaratorId, "ObjectPattern")) { + declaratorId.properties.forEach(prop => { + parseDeclarator(prop.value, targetScope, type); + }); + } else if (isNode(declaratorId, "ArrayPattern")) { + declaratorId.elements.forEach(item => { + parseDeclarator(item, targetScope, type); + }); + } else if (isNode(declaratorId, "AssignmentPattern")) { + parseDeclarator(declaratorId.left, targetScope, type); + } else if (isNode(declaratorId, "RestElement")) { + parseDeclarator(declaratorId.argument, targetScope, type); + } +} + +function isLetOrConst(node) { + return node.kind === "let" || node.kind === "const"; +} + +function hasLetOrConst(path) { + return path.node.body.some(node => { + if (!isNode(node, "VariableDeclaration")) { + return false; + } + return isLetOrConst(node); + }); +} + +function findIdentifierInScopes(scope, name) { + // Find nearest outer scope with the specifed name and add reference. + for (let s = scope; s; s = s.parent) { + if (name in s.names) { + return s; + } + } + return null; +} + +function toParsedScopes(children, sourceId) { + if (!children || children.length === 0) { + return undefined; + } + return children.map(scope => { + // Removing unneed information from TempScope such as parent reference and + // name types. We also need to convert BabelLocation to the Location type. + const bindings = Object.keys(scope.names).reduce((_bindings, n) => { + const nameRefs = scope.names[n]; + switch (nameRefs.type) { + case "var": + case "let": + case "const": + case "param": + _bindings[n] = nameRefs.refs.map(location => { + return fromBabelLocation(location, sourceId); + }); + break; + } + return _bindings; + }, Object.create(null)); + return { + start: fromBabelLocation(scope.loc.start, sourceId), + end: fromBabelLocation(scope.loc.end, sourceId), + type: scope.type.toLowerCase(), + bindings, + children: toParsedScopes(scope.children, sourceId) + }; + }); +} + +/** + * Creates at visitor for babel-traverse that will parse/extract all bindings + * information from the source. See also findScopes to perform lookup of the + * scope information for specific location. + */ +function createParseJSScopeVisitor(sourceId) { + let parent = createTempScope("Global", null, null); + let savedParents = new WeakMap(); + const traverseVisitor = { + enter(path) { + const tree = path.node; + const location = path.node.loc; + if (path.isProgram()) { + savedParents.set(path, parent); + parent = createTempScope("Script", parent, location); + return; + } + if (path.isFunctionDeclaration() || path.isFunctionExpression() || path.isArrowFunctionExpression()) { + savedParents.set(path, parent); + const scope = createTempScope("Function", parent, location); + if (isNode(tree.id, "Identifier")) { + const functionName = { type: "fn", refs: [] }; + getFunctionScope(parent).names[tree.id.name] = functionName; + scope.names[tree.id.name] = functionName; + } + tree.params.forEach(param => parseDeclarator(param, scope, "param")); + parent = scope; + return; + } + if (path.isForInStatement() || path.isForStatement()) { + const init = tree.init || tree.left; + if (isNode(init, "VariableDeclaration") && isLetOrConst(init)) { + // Debugger will create new lexical environment for the for. + savedParents.set(path, parent); + parent = createTempScope("For", parent, location); + } + return; + } + if (path.isCatchClause()) { + savedParents.set(path, parent); + parent = createTempScope("Catch", parent, location); + parseDeclarator(tree.param, parent, "param"); + return; + } + if (path.isBlockStatement()) { + if (hasLetOrConst(path)) { + // Debugger will create new lexical environment for the block. + savedParents.set(path, parent); + parent = createTempScope("Block", parent, location); + } + return; + } + if (path.isVariableDeclaration()) { + // Finds right lexical environment + const hoistAt = !isLetOrConst(tree) ? getFunctionScope(parent) : parent; + tree.declarations.forEach(declarator => { + parseDeclarator(declarator.id, hoistAt, tree.kind); + }); + return; + } + if (path.isIdentifier()) { + const scope = findIdentifierInScopes(parent, tree.name); + if (scope) { + scope.names[tree.name].refs.push(tree.loc.start); + } + } + }, + exit(path) { + const savedParent = savedParents.get(path); + if (savedParent) { + parent = savedParent; + savedParents.delete(path); + } + } + }; + return { + traverseVisitor, + toParsedScopes() { + return toParsedScopes(parent.children, sourceId) || []; + } + }; +} + +function compareLocations(a, b) { + // According to type of Location.column can be undefined, if will not be the + // case here, ignoring flow error. + // $FlowIgnore + return a.line == b.line ? a.column - b.column : a.line - b.line; +} + +/** + * Searches all scopes and their bindings at the specific location. + */ +function findScopes(scopes, location) { + // Find inner most in the tree structure. + let searchInScopes = scopes; + const found = []; + while (searchInScopes) { + let foundOne = searchInScopes.some(s => { + if (compareLocations(s.start, location) <= 0 && compareLocations(location, s.end) < 0) { + // Found the next scope, trying to search recusevly in its children. + found.unshift(s); + searchInScopes = s.children; + return true; + } + return false; + }); + if (!foundOne) { + break; + } + } + return found.map(i => { + return { + type: i.type, + start: i.start, + end: i.end, + bindings: i.bindings + }; + }); +} + +module.exports = { + createParseJSScopeVisitor, + findScopes +}; + /***/ }) /******/ ]); }); \ No newline at end of file diff --git a/devtools/client/debugger/new/search-worker.js b/devtools/client/debugger/new/search-worker.js index 83b75bdbd373..21cf99a7fa9f 100644 --- a/devtools/client/debugger/new/search-worker.js +++ b/devtools/client/debugger/new/search-worker.js @@ -600,6 +600,87 @@ module.exports = { /***/ }), +/***/ 1172: +/***/ (function(module, exports, __webpack_require__) { + +/* 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/. */ + +const md5 = __webpack_require__(248); + +function originalToGeneratedId(originalId) { + const match = originalId.match(/(.*)\/originalSource/); + return match ? match[1] : ""; +} + +function generatedToOriginalId(generatedId, url) { + return `${generatedId}/originalSource-${md5(url)}`; +} + +function isOriginalId(id) { + return !!id.match(/\/originalSource/); +} + +function isGeneratedId(id) { + return !isOriginalId(id); +} + +/** + * Trims the query part or reference identifier of a URL string, if necessary. + */ +function trimUrlQuery(url) { + let length = url.length; + let q1 = url.indexOf("?"); + let q2 = url.indexOf("&"); + let q3 = url.indexOf("#"); + let q = Math.min(q1 != -1 ? q1 : length, q2 != -1 ? q2 : length, q3 != -1 ? q3 : length); + + return url.slice(0, q); +} + +// Map suffix to content type. +const contentMap = { + "js": "text/javascript", + "jsm": "text/javascript", + "ts": "text/typescript", + "tsx": "text/typescript-jsx", + "jsx": "text/jsx", + "coffee": "text/coffeescript", + "elm": "text/elm", + "cljs": "text/x-clojure" +}; + +/** + * Returns the content type for the specified URL. If no specific + * content type can be determined, "text/plain" is returned. + * + * @return String + * The content type. + */ +function getContentType(url) { + url = trimUrlQuery(url); + let dot = url.lastIndexOf("."); + if (dot >= 0) { + let name = url.substring(dot + 1); + if (name in contentMap) { + return contentMap[name]; + } + } + return "text/plain"; +} + +module.exports = { + originalToGeneratedId, + generatedToOriginalId, + isOriginalId, + isGeneratedId, + getContentType, + contentMapForTesting: contentMap +}; + +/***/ }), + /***/ 1173: /***/ (function(module, exports, __webpack_require__) { @@ -907,7 +988,7 @@ function shouldPrettyPrint(source) { } var _isPretty = isPretty(source); - var _isJavaScript = isJavaScript(source.url); + var _isJavaScript = isJavaScript(source); var isOriginal = (0, _devtoolsSourceMap.isOriginalId)(source.id); var hasSourceMap = source.sourceMapURL; @@ -928,10 +1009,8 @@ function shouldPrettyPrint(source) { * @memberof utils/source * @static */ -function isJavaScript(url) { - var contentType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; - - return url && /\.(jsm|js)?$/.test(trimUrlQuery(url)) || contentType.includes("javascript"); +function isJavaScript(source) { + return source.url && /\.(jsm|js)?$/.test(trimUrlQuery(source.url)) || !!(source.contentType && source.contentType.includes("javascript")); } /** @@ -2608,7 +2687,7 @@ const { generatedToOriginalId, isGeneratedId, isOriginalId -} = __webpack_require__(899); +} = __webpack_require__(1172); const { workerUtils: { WorkerDispatcher } } = __webpack_require__(1165); @@ -2617,6 +2696,7 @@ const dispatcher = new WorkerDispatcher(); const getOriginalURLs = dispatcher.task("getOriginalURLs"); const getGeneratedLocation = dispatcher.task("getGeneratedLocation"); const getOriginalLocation = dispatcher.task("getOriginalLocation"); +const getLocationScopes = dispatcher.task("getLocationScopes"); const getOriginalSourceText = dispatcher.task("getOriginalSourceText"); const applySourceMap = dispatcher.task("applySourceMap"); const clearSourceMaps = dispatcher.task("clearSourceMaps"); @@ -2631,6 +2711,7 @@ module.exports = { getOriginalURLs, getGeneratedLocation, getOriginalLocation, + getLocationScopes, getOriginalSourceText, applySourceMap, clearSourceMaps, @@ -2640,87 +2721,6 @@ module.exports = { /***/ }), -/***/ 899: -/***/ (function(module, exports, __webpack_require__) { - -/* 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/. */ - -const md5 = __webpack_require__(248); - -function originalToGeneratedId(originalId) { - const match = originalId.match(/(.*)\/originalSource/); - return match ? match[1] : ""; -} - -function generatedToOriginalId(generatedId, url) { - return `${generatedId}/originalSource-${md5(url)}`; -} - -function isOriginalId(id) { - return !!id.match(/\/originalSource/); -} - -function isGeneratedId(id) { - return !isOriginalId(id); -} - -/** - * Trims the query part or reference identifier of a URL string, if necessary. - */ -function trimUrlQuery(url) { - let length = url.length; - let q1 = url.indexOf("?"); - let q2 = url.indexOf("&"); - let q3 = url.indexOf("#"); - let q = Math.min(q1 != -1 ? q1 : length, q2 != -1 ? q2 : length, q3 != -1 ? q3 : length); - - return url.slice(0, q); -} - -// Map suffix to content type. -const contentMap = { - "js": "text/javascript", - "jsm": "text/javascript", - "ts": "text/typescript", - "tsx": "text/typescript-jsx", - "jsx": "text/jsx", - "coffee": "text/coffeescript", - "elm": "text/elm", - "cljs": "text/x-clojure" -}; - -/** - * Returns the content type for the specified URL. If no specific - * content type can be determined, "text/plain" is returned. - * - * @return String - * The content type. - */ -function getContentType(url) { - url = trimUrlQuery(url); - let dot = url.lastIndexOf("."); - if (dot >= 0) { - let name = url.substring(dot + 1); - if (name in contentMap) { - return contentMap[name]; - } - } - return "text/plain"; -} - -module.exports = { - originalToGeneratedId, - generatedToOriginalId, - isOriginalId, - isGeneratedId, - getContentType, - contentMapForTesting: contentMap -}; - -/***/ }), - /***/ 9: /***/ (function(module, exports, __webpack_require__) { diff --git a/devtools/client/debugger/new/test/mochitest/browser.ini b/devtools/client/debugger/new/test/mochitest/browser.ini index e1007d936dce..5cfdda843359 100644 --- a/devtools/client/debugger/new/test/mochitest/browser.ini +++ b/devtools/client/debugger/new/test/mochitest/browser.ini @@ -11,6 +11,11 @@ support-files = examples/sourcemaps2/main.min.js examples/sourcemaps2/main.js examples/sourcemaps2/main.js.map + examples/wasm-sourcemaps/average.js + examples/wasm-sourcemaps/average.wasm + examples/wasm-sourcemaps/average.wasm.map + examples/wasm-sourcemaps/average.c + examples/wasm-sourcemaps/utils.js examples/doc-async.html examples/doc-asm.html examples/doc-scripts.html @@ -26,6 +31,7 @@ support-files = examples/doc-sourcemap-bogus.html examples/doc-sources.html examples/doc-return-values.html + examples/doc-wasm-sourcemaps.html examples/asm.js examples/async.js examples/bogus-map.js @@ -44,6 +50,7 @@ support-files = examples/script-switching-01.js examples/times2.js +[browser_dbg-asm.js] [browser_dbg-async-stepping.js] [browser_dbg-breaking.js] [browser_dbg-breaking-from-console.js] @@ -54,6 +61,7 @@ skip-if = true # Bug 1383576 [browser_dbg-breakpoints-cond.js] [browser_dbg-call-stack.js] [browser_dbg-expressions.js] +[browser_dbg-expressions-error.js] [browser_dbg-scopes.js] [browser_dbg-chrome-create.js] [browser_dbg-chrome-debugging.js] @@ -89,3 +97,5 @@ skip-if = true # Bug 1393121, 1393299 [browser_dbg-sources.js] [browser_dbg-tabs.js] [browser_dbg-toggling-tools.js] +[browser_dbg-wasm-sourcemaps.js] +skip-if = true diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-asm.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-asm.js index 903a5bb86267..a63aa18ea271 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-asm.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-asm.js @@ -1,15 +1,25 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ +add_task(async function() { + const dbg = await initDebugger("doc-asm.html"); + await reload(dbg); -// Tests that asm.js AOT can be disabled and debugging of the asm.js code -// is working. + // After reload() we are getting getSources notifiction for old sources, + // using the debugger statement to really stop are reloaded page. + await waitForPaused(dbg); + await resume(dbg); -const { - setupTestRunner, - asm -} = require("devtools/client/debugger/new/integration-tests"); + await waitForSources(dbg, "doc-asm.html", "asm.js"); -add_task(function*() { - setupTestRunner(this); - yield asm(this); + // Expand nodes and make sure more sources appear. + is(findAllElements(dbg, "sourceNodes").length, 2); + + await clickElement(dbg, "sourceArrow", 2); + is(findAllElements(dbg, "sourceNodes").length, 4); + + await selectSource(dbg, "asm.js"); + + await addBreakpoint(dbg, "asm.js", 7); + invokeInTab("runAsm"); + + await waitForPaused(dbg); + assertPausedLocation(dbg, "asm.js", 7); }); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-cond.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-cond.js index 1adcf1d3f233..7b124f613ca4 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-cond.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-cond.js @@ -39,21 +39,21 @@ add_task(async function() { const dbg = await initDebugger("doc-scripts.html"); await selectSource(dbg, "simple2"); - // Adding a conditional Breakpoint + dump('Adding a conditional Breakpoint\n') await setConditionalBreakpoint(dbg, 5, "1"); await waitForDispatch(dbg, "ADD_BREAKPOINT"); let bp = findBreakpoint(dbg, "simple2", 5); is(bp.condition, "1", "breakpoint is created with the condition"); assertEditorBreakpoint(dbg, 5, true); - // Editing a conditional Breakpoint + dump('Editing a conditional breakpoint\n') await setConditionalBreakpoint(dbg, 5, "2"); await waitForDispatch(dbg, "SET_BREAKPOINT_CONDITION"); bp = findBreakpoint(dbg, "simple2", 5); is(bp.condition, "12", "breakpoint is created with the condition"); assertEditorBreakpoint(dbg, 5, true); - // Removing a conditional breakpoint + dump("Removing a conditional breakpoint\n") clickElement(dbg, "gutter", 5); await waitForDispatch(dbg, "REMOVE_BREAKPOINT"); bp = findBreakpoint(dbg, "simple2", 5); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-call-stack.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-call-stack.js index 670a79f6b28a..d3686a87bf7a 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-call-stack.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-call-stack.js @@ -23,7 +23,7 @@ add_task(async function() { toggleCallStack(dbg); const notPaused = findElement(dbg, "callStackBody").innerText; - is(notPaused, "Not Paused", "Not paused message is shown"); + is(notPaused, "Not paused", "Not paused message is shown"); invokeInTab("firstCall"); await waitForPaused(dbg); @@ -47,13 +47,13 @@ add_task(async function() { // check to make sure that the toggle button isn't there let button = toggleButton(dbg); let frames = findAllElements(dbg, "frames"); - is(button.innerText, "Expand Rows", "toggle button should be expand"); + is(button.innerText, "Expand rows", "toggle button should be expand"); is(frames.length, 7, "There should be at most seven frames"); button.click(); button = toggleButton(dbg); frames = findAllElements(dbg, "frames"); - is(button.innerText, "Collapse Rows", "toggle button should be collapsed"); + is(button.innerText, "Collapse rows", "toggle button should be collapsed"); is(frames.length, 22, "All of the frames should be shown"); }); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions-error.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions-error.js new file mode 100644 index 000000000000..a65d6d72c589 --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions-error.js @@ -0,0 +1,74 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * test pausing on an errored watch expression + * assert that you can: + * 1. resume + * 2. still evalutate expressions + */ + +const expressionSelectors = { + input: "input.input-expression" +}; + +function getLabel(dbg, index) { + return findElement(dbg, "expressionNode", index).innerText; +} + +function getValue(dbg, index) { + return findElement(dbg, "expressionValue", index).innerText; +} + +function assertEmptyValue(dbg, index) { + const value = findElement(dbg, "expressionValue", index); + if (value) { + is(value.innerText, ""); + return; + } + + is(value, null); +} + +function toggleExpression(dbg, index) { + findElement(dbg, "expressionNode", index).click(); +} + +async function addExpression(dbg, input) { + info("Adding an expression"); + findElementWithSelector(dbg, expressionSelectors.input).focus(); + type(dbg, input); + pressKey(dbg, "Enter"); + + await waitForDispatch(dbg, "EVALUATE_EXPRESSION"); +} + +async function editExpression(dbg, input) { + info("updating the expression"); + dblClickElement(dbg, "expressionNode", 1); + // Position cursor reliably at the end of the text. + pressKey(dbg, "End"); + type(dbg, input); + pressKey(dbg, "Enter"); + await waitForDispatch(dbg, "EVALUATE_EXPRESSION"); +} + +add_task(async function() { + const dbg = await initDebugger("doc-script-switching.html"); + + await togglePauseOnExceptions(dbg, true, false); + await addExpression(dbg, "location"); + + const paused = waitForPaused(dbg); + addExpression(dbg, "foo.bar"); + await paused; + ok(dbg.selectors.hasWatchExpressionErrored(dbg.getState())); + + // Resume, and re-pause in the `foo.bar` exception + resume(dbg); + await waitForPaused(dbg); + + toggleExpression(dbg, 1); + await waitForDispatch(dbg, "LOAD_OBJECT_PROPERTIES"); + is(findAllElements(dbg, "expressionNodes").length, 18); +}); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js index 1e6e4d207a5b..136421b69850 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js @@ -6,6 +6,7 @@ * 1. add watch expressions * 2. edit watch expressions * 3. delete watch expressions + * 4. expanding properties when not paused */ const expressionSelectors = { @@ -61,7 +62,7 @@ add_task(async function() { await addExpression(dbg, "f"); is(getLabel(dbg, 1), "f"); - is(getValue(dbg, 1), `"ReferenceError: f is not defined"`); + is(getValue(dbg, 1), "(unavailable)"); await editExpression(dbg, "oo"); is(getLabel(dbg, 1), "foo()"); @@ -79,6 +80,15 @@ add_task(async function() { await deleteExpression(dbg, "foo"); await deleteExpression(dbg, "location"); + is(findAllElements(dbg, "expressionNodes").length, 0); + // Test expanding properties when the debuggee is active + await resume(dbg); + await addExpression(dbg, "location"); + toggleExpression(dbg, 1); + await waitForDispatch(dbg, "LOAD_OBJECT_PROPERTIES"); + is(findAllElements(dbg, "expressionNodes").length, 17); + + await deleteExpression(dbg, "location"); is(findAllElements(dbg, "expressionNodes").length, 0); }); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-pretty-print-console.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-pretty-print-console.js index 4f0d7e5bb855..a57359d520d6 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-pretty-print-console.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-pretty-print-console.js @@ -10,7 +10,7 @@ async function waitFor(condition) { return condition(); } -add_task(async function () { +add_task(async function() { const dbg = await initDebugger("doc-minified.html"); invokeInTab("arithmetic"); @@ -19,7 +19,9 @@ add_task(async function () { const console = await toolbox.selectTool("webconsole"); const hud = console.hud; - let node = await waitFor(() => hud.ui.outputNode.querySelector(".frame-link-source")); + let node = await waitFor(() => + hud.ui.outputNode.querySelector(".frame-link-source") + ); const initialLocation = "math.min.js:3:65"; is(node.textContent, initialLocation, "location is correct in minified code"); @@ -43,5 +45,9 @@ add_task(async function () { return found; }); - is(node.textContent, "math.min.js:formatted:22", "location is correct in minified code"); + is( + node.textContent, + "math.min.js:formatted:22", + "location is correct in minified code" + ); }); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-sources.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-sources.js index 2d185a9902e1..55068befa2a9 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-sources.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-sources.js @@ -11,6 +11,10 @@ async function waitForSourceCount(dbg, i) { }); } +function getLabel(dbg, index) { + return findElement(dbg, "sourceNode", index).textContent.trim(); +} + add_task(async function() { const dbg = await initDebugger("doc-sources.html"); const { selectors: { getSelectedSource }, getState } = dbg; @@ -53,11 +57,7 @@ add_task(async function() { }); await waitForSourceCount(dbg, 9); - is( - findElement(dbg, "sourceNode", 7).textContent, - "math.min.js", - "The dynamic script exists" - ); + is(getLabel(dbg, 7), "math.min.js", "The dynamic script exists"); // Make sure named eval sources appear in the list. }); @@ -72,20 +72,6 @@ add_task(async function() { content.eval("window.evaledFunc = function() {} //# sourceURL=evaled.js"); }); await waitForSourceCount(dbg, 3); - is( - findElement(dbg, "sourceNode", 3).textContent, - "(no domain)", - "the folder exists" - ); - // work around: the folder is rendered at the bottom, so we close the - // root folder and open the (no domain) folder - await clickElement(dbg, "sourceArrow", 3); - await waitForSourceCount(dbg, 4); - - is( - findElement(dbg, "sourceNode", 4).textContent, - "evaled.js", - "the eval script exists" - ); + is(getLabel(dbg, 3), "evaled.js", "the eval script exists"); }); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-wasm-sourcemaps.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-wasm-sourcemaps.js new file mode 100644 index 000000000000..14eeb332b347 --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-wasm-sourcemaps.js @@ -0,0 +1,30 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Test WebAssembly source maps + */ +add_task(async function() { + const dbg = await initDebugger("doc-wasm-sourcemaps.html"); + + await reload(dbg); + await waitForPaused(dbg); + assertPausedLocation(dbg); + + await addBreakpoint(dbg, "wasm-sourcemaps/average.c", 12); + + clickElement(dbg, "resume"); + + await waitForPaused(dbg); + assertPausedLocation(dbg); + + const frames = findAllElements(dbg, "frames"); + const firstFrameTitle = frames[0].querySelector(".title").textContent; + is(firstFrameTitle, "(wasmcall)", "It shall be a wasm call"); + const firstFrameLocation = frames[0].querySelector(".location").textContent; + is( + firstFrameLocation.includes("average.c"), + true, + "It shall be to avarage.c source" + ); +}); diff --git a/devtools/client/debugger/new/test/mochitest/examples/doc-wasm-sourcemaps.html b/devtools/client/debugger/new/test/mochitest/examples/doc-wasm-sourcemaps.html new file mode 100644 index 000000000000..05e8da57737b --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/examples/doc-wasm-sourcemaps.html @@ -0,0 +1,59 @@ + + + + + + Wasm+sourcemaps + + + + + + + diff --git a/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/README.md b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/README.md new file mode 100644 index 000000000000..40155e67dee7 --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/README.md @@ -0,0 +1,5 @@ +# Building WebAssembly source and source maps + +``` +emcc average.c -O2 -g4 -o average.js -s WASM=1 -s EXPORTED_FUNCTIONS="['_average','_sum']" +``` diff --git a/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.c b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.c new file mode 100644 index 000000000000..cff2cbe914b3 --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.c @@ -0,0 +1,21 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +extern float average(signed* numbers, unsigned length); +extern signed sum(signed* numbers, unsigned length); + +signed __attribute__((noinline)) sum(signed* numbers, unsigned length) +{ + signed result; + unsigned i; + result = 0; + for (i = 0; i < length; i++) + result += numbers[i]; + return result; +} + +float average(signed* numbers, unsigned length) +{ + float s = (float)sum(numbers, length); + return s / length; +} diff --git a/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.js b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.js new file mode 100644 index 000000000000..a23b7d0ab51a --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.js @@ -0,0 +1,2685 @@ +// The Module object: Our interface to the outside world. We import +// and export values on it, and do the work to get that through +// closure compiler if necessary. There are various ways Module can be used: +// 1. Not defined. We create it here +// 2. A function parameter, function(Module) { ..generated code.. } +// 3. pre-run appended it, var Module = {}; ..generated code.. +// 4. External script tag defines var Module. +// We need to do an eval in order to handle the closure compiler +// case, where this code here is minified but Module was defined +// elsewhere (e.g. case 4 above). We also need to check if Module +// already exists (e.g. case 3 above). +// Note that if you want to run closure, and also to use Module +// after the generated code, you will need to define var Module = {}; +// before the code. Then that object will be used in the code, and you +// can continue to use Module afterwards as well. +var Module; +if (!Module) Module = (typeof Module !== "undefined" ? Module : null) || {}; + +// Sometimes an existing Module object exists with properties +// meant to overwrite the default module functionality. Here +// we collect those properties and reapply _after_ we configure +// the current environment's defaults to avoid having to be so +// defensive during initialization. +var moduleOverrides = {}; +for (var key in Module) { + if (Module.hasOwnProperty(key)) { + moduleOverrides[key] = Module[key]; + } +} + +// The environment setup code below is customized to use Module. +// *** Environment setup code *** +var ENVIRONMENT_IS_WEB = false; +var ENVIRONMENT_IS_WORKER = false; +var ENVIRONMENT_IS_NODE = false; +var ENVIRONMENT_IS_SHELL = false; + +// Three configurations we can be running in: +// 1) We could be the application main() thread running in the main JS UI thread. (ENVIRONMENT_IS_WORKER == false and ENVIRONMENT_IS_PTHREAD == false) +// 2) We could be the application main() thread proxied to worker. (with Emscripten -s PROXY_TO_WORKER=1) (ENVIRONMENT_IS_WORKER == true, ENVIRONMENT_IS_PTHREAD == false) +// 3) We could be an application pthread running in a worker. (ENVIRONMENT_IS_WORKER == true and ENVIRONMENT_IS_PTHREAD == true) + +if (Module["ENVIRONMENT"]) { + if (Module["ENVIRONMENT"] === "WEB") { + ENVIRONMENT_IS_WEB = true; + } else if (Module["ENVIRONMENT"] === "WORKER") { + ENVIRONMENT_IS_WORKER = true; + } else if (Module["ENVIRONMENT"] === "NODE") { + ENVIRONMENT_IS_NODE = true; + } else if (Module["ENVIRONMENT"] === "SHELL") { + ENVIRONMENT_IS_SHELL = true; + } else { + throw new Error( + "The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL." + ); + } +} else { + ENVIRONMENT_IS_WEB = typeof window === "object"; + ENVIRONMENT_IS_WORKER = typeof importScripts === "function"; + ENVIRONMENT_IS_NODE = + typeof process === "object" && + typeof require === "function" && + !ENVIRONMENT_IS_WEB && + !ENVIRONMENT_IS_WORKER; + ENVIRONMENT_IS_SHELL = + !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; +} + +if (ENVIRONMENT_IS_NODE) { + // Expose functionality in the same simple way that the shells work + // Note that we pollute the global namespace here, otherwise we break in node + if (!Module["print"]) Module["print"] = console.log; + if (!Module["printErr"]) Module["printErr"] = console.warn; + + var nodeFS; + var nodePath; + + Module["read"] = function shell_read(filename, binary) { + if (!nodeFS) nodeFS = require("fs"); + if (!nodePath) nodePath = require("path"); + filename = nodePath["normalize"](filename); + var ret = nodeFS["readFileSync"](filename); + return binary ? ret : ret.toString(); + }; + + Module["readBinary"] = function readBinary(filename) { + var ret = Module["read"](filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret); + } + assert(ret.buffer); + return ret; + }; + + Module["load"] = function load(f) { + globalEval(read(f)); + }; + + if (!Module["thisProgram"]) { + if (process["argv"].length > 1) { + Module["thisProgram"] = process["argv"][1].replace(/\\/g, "/"); + } else { + Module["thisProgram"] = "unknown-program"; + } + } + + Module["arguments"] = process["argv"].slice(2); + + if (typeof module !== "undefined") { + module["exports"] = Module; + } + + process["on"]("uncaughtException", function(ex) { + // suppress ExitStatus exceptions from showing an error + if (!(ex instanceof ExitStatus)) { + throw ex; + } + }); + + Module["inspect"] = function() { + return "[Emscripten Module object]"; + }; +} else if (ENVIRONMENT_IS_SHELL) { + if (!Module["print"]) Module["print"] = print; + if (typeof printErr != "undefined") Module["printErr"] = printErr; // not present in v8 or older sm + + if (typeof read != "undefined") { + Module["read"] = read; + } else { + Module["read"] = function shell_read() { + throw "no read() available"; + }; + } + + Module["readBinary"] = function readBinary(f) { + if (typeof readbuffer === "function") { + return new Uint8Array(readbuffer(f)); + } + var data = read(f, "binary"); + assert(typeof data === "object"); + return data; + }; + + if (typeof scriptArgs != "undefined") { + Module["arguments"] = scriptArgs; + } else if (typeof arguments != "undefined") { + Module["arguments"] = arguments; + } + + if (typeof quit === "function") { + Module["quit"] = function(status, toThrow) { + quit(status); + }; + } +} else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + Module["read"] = function shell_read(url) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, false); + xhr.send(null); + return xhr.responseText; + }; + + if (ENVIRONMENT_IS_WORKER) { + Module["readBinary"] = function readBinary(url) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, false); + xhr.responseType = "arraybuffer"; + xhr.send(null); + return new Uint8Array(xhr.response); + }; + } + + Module["readAsync"] = function readAsync(url, onload, onerror) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, true); + xhr.responseType = "arraybuffer"; + xhr.onload = function xhr_onload() { + if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { + // file URLs can return 0 + onload(xhr.response); + } else { + onerror(); + } + }; + xhr.onerror = onerror; + xhr.send(null); + }; + + if (typeof arguments != "undefined") { + Module["arguments"] = arguments; + } + + if (typeof console !== "undefined") { + if (!Module["print"]) + Module["print"] = function shell_print(x) { + console.log(x); + }; + if (!Module["printErr"]) + Module["printErr"] = function shell_printErr(x) { + console.warn(x); + }; + } else { + // Probably a worker, and without console.log. We can do very little here... + var TRY_USE_DUMP = false; + if (!Module["print"]) + Module["print"] = + TRY_USE_DUMP && typeof dump !== "undefined" + ? function(x) { + dump(x); + } + : function(x) { + // self.postMessage(x); // enable this if you want stdout to be sent as messages + }; + } + + if (ENVIRONMENT_IS_WORKER) { + Module["load"] = importScripts; + } + + if (typeof Module["setWindowTitle"] === "undefined") { + Module["setWindowTitle"] = function(title) { + document.title = title; + }; + } +} else { + // Unreachable because SHELL is dependant on the others + throw "Unknown runtime environment. Where are we?"; +} + +function globalEval(x) { + eval.call(null, x); +} +if (!Module["load"] && Module["read"]) { + Module["load"] = function load(f) { + globalEval(Module["read"](f)); + }; +} +if (!Module["print"]) { + Module["print"] = function() {}; +} +if (!Module["printErr"]) { + Module["printErr"] = Module["print"]; +} +if (!Module["arguments"]) { + Module["arguments"] = []; +} +if (!Module["thisProgram"]) { + Module["thisProgram"] = "./this.program"; +} +if (!Module["quit"]) { + Module["quit"] = function(status, toThrow) { + throw toThrow; + }; +} + +// *** Environment setup code *** + +// Closure helpers +Module.print = Module["print"]; +Module.printErr = Module["printErr"]; + +// Callbacks +Module["preRun"] = []; +Module["postRun"] = []; + +// Merge back in the overrides +for (var key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module[key] = moduleOverrides[key]; + } +} +// Free the object hierarchy contained in the overrides, this lets the GC +// reclaim data used e.g. in memoryInitializerRequest, which is a large typed array. +moduleOverrides = undefined; + +// {{PREAMBLE_ADDITIONS}} + +// === Preamble library stuff === + +// Documentation for the public APIs defined in this file must be updated in: +// site/source/docs/api_reference/preamble.js.rst +// A prebuilt local version of the documentation is available at: +// site/build/text/docs/api_reference/preamble.js.txt +// You can also build docs locally as HTML or other formats in site/ +// An online HTML version (which may be of a different version of Emscripten) +// is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html + +//======================================== +// Runtime code shared with compiler +//======================================== + +var Runtime = { + setTempRet0: function(value) { + tempRet0 = value; + return value; + }, + getTempRet0: function() { + return tempRet0; + }, + stackSave: function() { + return STACKTOP; + }, + stackRestore: function(stackTop) { + STACKTOP = stackTop; + }, + getNativeTypeSize: function(type) { + switch (type) { + case "i1": + case "i8": + return 1; + case "i16": + return 2; + case "i32": + return 4; + case "i64": + return 8; + case "float": + return 4; + case "double": + return 8; + default: { + if (type[type.length - 1] === "*") { + return Runtime.QUANTUM_SIZE; // A pointer + } else if (type[0] === "i") { + var bits = parseInt(type.substr(1)); + assert(bits % 8 === 0); + return bits / 8; + } else { + return 0; + } + } + } + }, + getNativeFieldSize: function(type) { + return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE); + }, + STACK_ALIGN: 16, + prepVararg: function(ptr, type) { + if (type === "double" || type === "i64") { + // move so the load is aligned + if (ptr & 7) { + assert((ptr & 7) === 4); + ptr += 4; + } + } else { + assert((ptr & 3) === 0); + } + return ptr; + }, + getAlignSize: function(type, size, vararg) { + // we align i64s and doubles on 64-bit boundaries, unlike x86 + if (!vararg && (type == "i64" || type == "double")) return 8; + if (!type) return Math.min(size, 8); // align structures internally to 64 bits + return Math.min( + size || (type ? Runtime.getNativeFieldSize(type) : 0), + Runtime.QUANTUM_SIZE + ); + }, + dynCall: function(sig, ptr, args) { + if (args && args.length) { + return Module["dynCall_" + sig].apply(null, [ptr].concat(args)); + } else { + return Module["dynCall_" + sig].call(null, ptr); + } + }, + functionPointers: [], + addFunction: function(func) { + for (var i = 0; i < Runtime.functionPointers.length; i++) { + if (!Runtime.functionPointers[i]) { + Runtime.functionPointers[i] = func; + return 2 * (1 + i); + } + } + throw "Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."; + }, + removeFunction: function(index) { + Runtime.functionPointers[(index - 2) / 2] = null; + }, + warnOnce: function(text) { + if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {}; + if (!Runtime.warnOnce.shown[text]) { + Runtime.warnOnce.shown[text] = 1; + Module.printErr(text); + } + }, + funcWrappers: {}, + getFuncWrapper: function(func, sig) { + if (!func) return; // on null pointer, return undefined + assert(sig); + if (!Runtime.funcWrappers[sig]) { + Runtime.funcWrappers[sig] = {}; + } + var sigCache = Runtime.funcWrappers[sig]; + if (!sigCache[func]) { + // optimize away arguments usage in common cases + if (sig.length === 1) { + sigCache[func] = function dynCall_wrapper() { + return Runtime.dynCall(sig, func); + }; + } else if (sig.length === 2) { + sigCache[func] = function dynCall_wrapper(arg) { + return Runtime.dynCall(sig, func, [arg]); + }; + } else { + // general case + sigCache[func] = function dynCall_wrapper() { + return Runtime.dynCall( + sig, + func, + Array.prototype.slice.call(arguments) + ); + }; + } + } + return sigCache[func]; + }, + getCompilerSetting: function(name) { + throw "You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"; + }, + stackAlloc: function(size) { + var ret = STACKTOP; + STACKTOP = (STACKTOP + size) | 0; + STACKTOP = (STACKTOP + 15) & -16; + return ret; + }, + staticAlloc: function(size) { + var ret = STATICTOP; + STATICTOP = (STATICTOP + size) | 0; + STATICTOP = (STATICTOP + 15) & -16; + return ret; + }, + dynamicAlloc: function(size) { + var ret = HEAP32[DYNAMICTOP_PTR >> 2]; + var end = ((ret + size + 15) | 0) & -16; + HEAP32[DYNAMICTOP_PTR >> 2] = end; + if (end >= TOTAL_MEMORY) { + var success = enlargeMemory(); + if (!success) { + HEAP32[DYNAMICTOP_PTR >> 2] = ret; + return 0; + } + } + return ret; + }, + alignMemory: function(size, quantum) { + var ret = (size = + Math.ceil(size / (quantum ? quantum : 16)) * (quantum ? quantum : 16)); + return ret; + }, + makeBigInt: function(low, high, unsigned) { + var ret = unsigned + ? +(low >>> 0) + +(high >>> 0) * 4294967296.0 + : +(low >>> 0) + +(high | 0) * 4294967296.0; + return ret; + }, + GLOBAL_BASE: 1024, + QUANTUM_SIZE: 4, + __dummy__: 0 +}; + +Module["Runtime"] = Runtime; + +//======================================== +// Runtime essentials +//======================================== + +var ABORT = 0; // whether we are quitting the application. no code should run after this. set in exit() and abort() +var EXITSTATUS = 0; + +/** @type {function(*, string=)} */ +function assert(condition, text) { + if (!condition) { + abort("Assertion failed: " + text); + } +} + +var globalScope = this; + +// Returns the C function with a specified identifier (for C++, you need to do manual name mangling) +function getCFunc(ident) { + var func = Module["_" + ident]; // closure exported function + if (!func) { + try { + func = eval("_" + ident); + } catch (e) {} + } + assert( + func, + "Cannot call unknown function " + + ident + + " (perhaps LLVM optimizations or closure removed it?)" + ); + return func; +} + +var cwrap, ccall; +(function() { + var JSfuncs = { + // Helpers for cwrap -- it can't refer to Runtime directly because it might + // be renamed by closure, instead it calls JSfuncs['stackSave'].body to find + // out what the minified function name is. + stackSave: function() { + Runtime.stackSave(); + }, + stackRestore: function() { + Runtime.stackRestore(); + }, + // type conversion from js to c + arrayToC: function(arr) { + var ret = Runtime.stackAlloc(arr.length); + writeArrayToMemory(arr, ret); + return ret; + }, + stringToC: function(str) { + var ret = 0; + if (str !== null && str !== undefined && str !== 0) { + // null string + // at most 4 bytes per UTF-8 code point, +1 for the trailing '\0' + var len = (str.length << 2) + 1; + ret = Runtime.stackAlloc(len); + stringToUTF8(str, ret, len); + } + return ret; + } + }; + // For fast lookup of conversion functions + var toC = { string: JSfuncs["stringToC"], array: JSfuncs["arrayToC"] }; + + // C calling interface. + ccall = function ccallFunc(ident, returnType, argTypes, args, opts) { + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) stack = Runtime.stackSave(); + cArgs[i] = converter(args[i]); + } else { + cArgs[i] = args[i]; + } + } + } + var ret = func.apply(null, cArgs); + if (returnType === "string") ret = Pointer_stringify(ret); + if (stack !== 0) { + if (opts && opts.async) { + EmterpreterAsync.asyncFinalizers.push(function() { + Runtime.stackRestore(stack); + }); + return; + } + Runtime.stackRestore(stack); + } + return ret; + }; + + var sourceRegex = /^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/; + function parseJSFunc(jsfunc) { + // Match the body and the return value of a javascript function source + var parsed = jsfunc + .toString() + .match(sourceRegex) + .slice(1); + return { arguments: parsed[0], body: parsed[1], returnValue: parsed[2] }; + } + + // sources of useful functions. we create this lazily as it can trigger a source decompression on this entire file + var JSsource = null; + function ensureJSsource() { + if (!JSsource) { + JSsource = {}; + for (var fun in JSfuncs) { + if (JSfuncs.hasOwnProperty(fun)) { + // Elements of toCsource are arrays of three items: + // the code, and the return value + JSsource[fun] = parseJSFunc(JSfuncs[fun]); + } + } + } + } + + cwrap = function cwrap(ident, returnType, argTypes) { + argTypes = argTypes || []; + var cfunc = getCFunc(ident); + // When the function takes numbers and returns a number, we can just return + // the original function + var numericArgs = argTypes.every(function(type) { + return type === "number"; + }); + var numericRet = returnType !== "string"; + if (numericRet && numericArgs) { + return cfunc; + } + // Creation of the arguments list (["$1","$2",...,"$nargs"]) + var argNames = argTypes.map(function(x, i) { + return "$" + i; + }); + var funcstr = "(function(" + argNames.join(",") + ") {"; + var nargs = argTypes.length; + if (!numericArgs) { + // Generate the code needed to convert the arguments from javascript + // values to pointers + ensureJSsource(); + funcstr += "var stack = " + JSsource["stackSave"].body + ";"; + for (var i = 0; i < nargs; i++) { + var arg = argNames[i], + type = argTypes[i]; + if (type === "number") continue; + var convertCode = JSsource[type + "ToC"]; // [code, return] + funcstr += "var " + convertCode.arguments + " = " + arg + ";"; + funcstr += convertCode.body + ";"; + funcstr += arg + "=(" + convertCode.returnValue + ");"; + } + } + + // When the code is compressed, the name of cfunc is not literally 'cfunc' anymore + var cfuncname = parseJSFunc(function() { + return cfunc; + }).returnValue; + // Call the function + funcstr += "var ret = " + cfuncname + "(" + argNames.join(",") + ");"; + if (!numericRet) { + // Return type can only by 'string' or 'number' + // Convert the result to a string + var strgfy = parseJSFunc(function() { + return Pointer_stringify; + }).returnValue; + funcstr += "ret = " + strgfy + "(ret);"; + } + if (!numericArgs) { + // If we had a stack, restore it + ensureJSsource(); + funcstr += JSsource["stackRestore"].body.replace("()", "(stack)") + ";"; + } + funcstr += "return ret})"; + return eval(funcstr); + }; +})(); +Module["ccall"] = ccall; +Module["cwrap"] = cwrap; + +/** @type {function(number, number, string, boolean=)} */ +function setValue(ptr, value, type, noSafe) { + type = type || "i8"; + if (type.charAt(type.length - 1) === "*") type = "i32"; // pointers are 32-bit + switch (type) { + case "i1": + HEAP8[ptr >> 0] = value; + break; + case "i8": + HEAP8[ptr >> 0] = value; + break; + case "i16": + HEAP16[ptr >> 1] = value; + break; + case "i32": + HEAP32[ptr >> 2] = value; + break; + case "i64": + (tempI64 = [ + value >>> 0, + ((tempDouble = value), + +Math_abs(tempDouble) >= 1.0 + ? tempDouble > 0.0 + ? (Math_min(+Math_floor(tempDouble / 4294967296.0), 4294967295.0) | + 0) >>> + 0 + : ~~+Math_ceil( + (tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0 + ) >>> 0 + : 0) + ]), + (HEAP32[ptr >> 2] = tempI64[0]), + (HEAP32[(ptr + 4) >> 2] = tempI64[1]); + break; + case "float": + HEAPF32[ptr >> 2] = value; + break; + case "double": + HEAPF64[ptr >> 3] = value; + break; + default: + abort("invalid type for setValue: " + type); + } +} +Module["setValue"] = setValue; + +/** @type {function(number, string, boolean=)} */ +function getValue(ptr, type, noSafe) { + type = type || "i8"; + if (type.charAt(type.length - 1) === "*") type = "i32"; // pointers are 32-bit + switch (type) { + case "i1": + return HEAP8[ptr >> 0]; + case "i8": + return HEAP8[ptr >> 0]; + case "i16": + return HEAP16[ptr >> 1]; + case "i32": + return HEAP32[ptr >> 2]; + case "i64": + return HEAP32[ptr >> 2]; + case "float": + return HEAPF32[ptr >> 2]; + case "double": + return HEAPF64[ptr >> 3]; + default: + abort("invalid type for setValue: " + type); + } + return null; +} +Module["getValue"] = getValue; + +var ALLOC_NORMAL = 0; // Tries to use _malloc() +var ALLOC_STACK = 1; // Lives for the duration of the current function call +var ALLOC_STATIC = 2; // Cannot be freed +var ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk +var ALLOC_NONE = 4; // Do not allocate +Module["ALLOC_NORMAL"] = ALLOC_NORMAL; +Module["ALLOC_STACK"] = ALLOC_STACK; +Module["ALLOC_STATIC"] = ALLOC_STATIC; +Module["ALLOC_DYNAMIC"] = ALLOC_DYNAMIC; +Module["ALLOC_NONE"] = ALLOC_NONE; + +// allocate(): This is for internal use. You can use it yourself as well, but the interface +// is a little tricky (see docs right below). The reason is that it is optimized +// for multiple syntaxes to save space in generated code. So you should +// normally not use allocate(), and instead allocate memory using _malloc(), +// initialize it with setValue(), and so forth. +// @slab: An array of data, or a number. If a number, then the size of the block to allocate, +// in *bytes* (note that this is sometimes confusing: the next parameter does not +// affect this!) +// @types: Either an array of types, one for each byte (or 0 if no type at that position), +// or a single type which is used for the entire block. This only matters if there +// is initial data - if @slab is a number, then this does not matter at all and is +// ignored. +// @allocator: How to allocate memory, see ALLOC_* +/** @type {function((TypedArray|Array|number), string, number, number=)} */ +function allocate(slab, types, allocator, ptr) { + var zeroinit, size; + if (typeof slab === "number") { + zeroinit = true; + size = slab; + } else { + zeroinit = false; + size = slab.length; + } + + var singleType = typeof types === "string" ? types : null; + + var ret; + if (allocator == ALLOC_NONE) { + ret = ptr; + } else { + ret = [ + typeof _malloc === "function" ? _malloc : Runtime.staticAlloc, + Runtime.stackAlloc, + Runtime.staticAlloc, + Runtime.dynamicAlloc + ][allocator === undefined ? ALLOC_STATIC : allocator]( + Math.max(size, singleType ? 1 : types.length) + ); + } + + if (zeroinit) { + var ptr = ret, + stop; + assert((ret & 3) == 0); + stop = ret + (size & ~3); + for (; ptr < stop; ptr += 4) { + HEAP32[ptr >> 2] = 0; + } + stop = ret + size; + while (ptr < stop) { + HEAP8[ptr++ >> 0] = 0; + } + return ret; + } + + if (singleType === "i8") { + if (slab.subarray || slab.slice) { + HEAPU8.set(/** @type {!Uint8Array} */ (slab), ret); + } else { + HEAPU8.set(new Uint8Array(slab), ret); + } + return ret; + } + + var i = 0, + type, + typeSize, + previousType; + while (i < size) { + var curr = slab[i]; + + if (typeof curr === "function") { + curr = Runtime.getFunctionIndex(curr); + } + + type = singleType || types[i]; + if (type === 0) { + i++; + continue; + } + + if (type == "i64") type = "i32"; // special case: we have one i32 here, and one i32 later + + setValue(ret + i, curr, type); + + // no need to look up size unless type changes, so cache it + if (previousType !== type) { + typeSize = Runtime.getNativeTypeSize(type); + previousType = type; + } + i += typeSize; + } + + return ret; +} +Module["allocate"] = allocate; + +// Allocate memory during any stage of startup - static memory early on, dynamic memory later, malloc when ready +function getMemory(size) { + if (!staticSealed) return Runtime.staticAlloc(size); + if (!runtimeInitialized) return Runtime.dynamicAlloc(size); + return _malloc(size); +} +Module["getMemory"] = getMemory; + +/** @type {function(number, number=)} */ +function Pointer_stringify(ptr, length) { + if (length === 0 || !ptr) return ""; + // TODO: use TextDecoder + // Find the length, and check for UTF while doing so + var hasUtf = 0; + var t; + var i = 0; + while (1) { + t = HEAPU8[(ptr + i) >> 0]; + hasUtf |= t; + if (t == 0 && !length) break; + i++; + if (length && i == length) break; + } + if (!length) length = i; + + var ret = ""; + + if (hasUtf < 128) { + var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack + var curr; + while (length > 0) { + curr = String.fromCharCode.apply( + String, + HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)) + ); + ret = ret ? ret + curr : curr; + ptr += MAX_CHUNK; + length -= MAX_CHUNK; + } + return ret; + } + return Module["UTF8ToString"](ptr); +} +Module["Pointer_stringify"] = Pointer_stringify; + +// Given a pointer 'ptr' to a null-terminated ASCII-encoded string in the emscripten HEAP, returns +// a copy of that string as a Javascript String object. + +function AsciiToString(ptr) { + var str = ""; + while (1) { + var ch = HEAP8[ptr++ >> 0]; + if (!ch) return str; + str += String.fromCharCode(ch); + } +} +Module["AsciiToString"] = AsciiToString; + +// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', +// null-terminated and encoded in ASCII form. The copy will require at most str.length+1 bytes of space in the HEAP. + +function stringToAscii(str, outPtr) { + return writeAsciiToMemory(str, outPtr, false); +} +Module["stringToAscii"] = stringToAscii; + +// Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the given array that contains uint8 values, returns +// a copy of that string as a Javascript String object. + +var UTF8Decoder = + typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined; +function UTF8ArrayToString(u8Array, idx) { + var endPtr = idx; + // TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself. + // Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage. + while (u8Array[endPtr]) ++endPtr; + + if (endPtr - idx > 16 && u8Array.subarray && UTF8Decoder) { + return UTF8Decoder.decode(u8Array.subarray(idx, endPtr)); + } else { + var u0, u1, u2, u3, u4, u5; + + var str = ""; + while (1) { + // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629 + u0 = u8Array[idx++]; + if (!u0) return str; + if (!(u0 & 0x80)) { + str += String.fromCharCode(u0); + continue; + } + u1 = u8Array[idx++] & 63; + if ((u0 & 0xe0) == 0xc0) { + str += String.fromCharCode(((u0 & 31) << 6) | u1); + continue; + } + u2 = u8Array[idx++] & 63; + if ((u0 & 0xf0) == 0xe0) { + u0 = ((u0 & 15) << 12) | (u1 << 6) | u2; + } else { + u3 = u8Array[idx++] & 63; + if ((u0 & 0xf8) == 0xf0) { + u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | u3; + } else { + u4 = u8Array[idx++] & 63; + if ((u0 & 0xfc) == 0xf8) { + u0 = ((u0 & 3) << 24) | (u1 << 18) | (u2 << 12) | (u3 << 6) | u4; + } else { + u5 = u8Array[idx++] & 63; + u0 = + ((u0 & 1) << 30) | + (u1 << 24) | + (u2 << 18) | + (u3 << 12) | + (u4 << 6) | + u5; + } + } + } + if (u0 < 0x10000) { + str += String.fromCharCode(u0); + } else { + var ch = u0 - 0x10000; + str += String.fromCharCode(0xd800 | (ch >> 10), 0xdc00 | (ch & 0x3ff)); + } + } + } +} +Module["UTF8ArrayToString"] = UTF8ArrayToString; + +// Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the emscripten HEAP, returns +// a copy of that string as a Javascript String object. + +function UTF8ToString(ptr) { + return UTF8ArrayToString(HEAPU8, ptr); +} +Module["UTF8ToString"] = UTF8ToString; + +// Copies the given Javascript String object 'str' to the given byte array at address 'outIdx', +// encoded in UTF8 form and null-terminated. The copy will require at most str.length*4+1 bytes of space in the HEAP. +// Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write. +// Parameters: +// str: the Javascript string to copy. +// outU8Array: the array to copy to. Each index in this array is assumed to be one 8-byte element. +// outIdx: The starting offset in the array to begin the copying. +// maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null +// terminator, i.e. if maxBytesToWrite=1, only the null terminator will be written and nothing else. +// maxBytesToWrite=0 does not write any bytes to the output, not even the null terminator. +// Returns the number of bytes written, EXCLUDING the null terminator. + +function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) { + if ( + !(maxBytesToWrite > 0) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes. + ) + return 0; + + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator. + for (var i = 0; i < str.length; ++i) { + // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description and https://www.ietf.org/rfc/rfc2279.txt and https://tools.ietf.org/html/rfc3629 + var u = str.charCodeAt(i); // possibly a lead surrogate + if (u >= 0xd800 && u <= 0xdfff) + u = (0x10000 + ((u & 0x3ff) << 10)) | (str.charCodeAt(++i) & 0x3ff); + if (u <= 0x7f) { + if (outIdx >= endIdx) break; + outU8Array[outIdx++] = u; + } else if (u <= 0x7ff) { + if (outIdx + 1 >= endIdx) break; + outU8Array[outIdx++] = 0xc0 | (u >> 6); + outU8Array[outIdx++] = 0x80 | (u & 63); + } else if (u <= 0xffff) { + if (outIdx + 2 >= endIdx) break; + outU8Array[outIdx++] = 0xe0 | (u >> 12); + outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63); + outU8Array[outIdx++] = 0x80 | (u & 63); + } else if (u <= 0x1fffff) { + if (outIdx + 3 >= endIdx) break; + outU8Array[outIdx++] = 0xf0 | (u >> 18); + outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63); + outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63); + outU8Array[outIdx++] = 0x80 | (u & 63); + } else if (u <= 0x3ffffff) { + if (outIdx + 4 >= endIdx) break; + outU8Array[outIdx++] = 0xf8 | (u >> 24); + outU8Array[outIdx++] = 0x80 | ((u >> 18) & 63); + outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63); + outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63); + outU8Array[outIdx++] = 0x80 | (u & 63); + } else { + if (outIdx + 5 >= endIdx) break; + outU8Array[outIdx++] = 0xfc | (u >> 30); + outU8Array[outIdx++] = 0x80 | ((u >> 24) & 63); + outU8Array[outIdx++] = 0x80 | ((u >> 18) & 63); + outU8Array[outIdx++] = 0x80 | ((u >> 12) & 63); + outU8Array[outIdx++] = 0x80 | ((u >> 6) & 63); + outU8Array[outIdx++] = 0x80 | (u & 63); + } + } + // Null-terminate the pointer to the buffer. + outU8Array[outIdx] = 0; + return outIdx - startIdx; +} +Module["stringToUTF8Array"] = stringToUTF8Array; + +// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', +// null-terminated and encoded in UTF8 form. The copy will require at most str.length*4+1 bytes of space in the HEAP. +// Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this function will write. +// Returns the number of bytes written, EXCLUDING the null terminator. + +function stringToUTF8(str, outPtr, maxBytesToWrite) { + return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); +} +Module["stringToUTF8"] = stringToUTF8; + +// Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte. + +function lengthBytesUTF8(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + var u = str.charCodeAt(i); // possibly a lead surrogate + if (u >= 0xd800 && u <= 0xdfff) + u = (0x10000 + ((u & 0x3ff) << 10)) | (str.charCodeAt(++i) & 0x3ff); + if (u <= 0x7f) { + ++len; + } else if (u <= 0x7ff) { + len += 2; + } else if (u <= 0xffff) { + len += 3; + } else if (u <= 0x1fffff) { + len += 4; + } else if (u <= 0x3ffffff) { + len += 5; + } else { + len += 6; + } + } + return len; +} +Module["lengthBytesUTF8"] = lengthBytesUTF8; + +// Given a pointer 'ptr' to a null-terminated UTF16LE-encoded string in the emscripten HEAP, returns +// a copy of that string as a Javascript String object. + +var UTF16Decoder = + typeof TextDecoder !== "undefined" ? new TextDecoder("utf-16le") : undefined; +function UTF16ToString(ptr) { + var endPtr = ptr; + // TextDecoder needs to know the byte length in advance, it doesn't stop on null terminator by itself. + // Also, use the length info to avoid running tiny strings through TextDecoder, since .subarray() allocates garbage. + var idx = endPtr >> 1; + while (HEAP16[idx]) ++idx; + endPtr = idx << 1; + + if (endPtr - ptr > 32 && UTF16Decoder) { + return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr)); + } else { + var i = 0; + + var str = ""; + while (1) { + var codeUnit = HEAP16[(ptr + i * 2) >> 1]; + if (codeUnit == 0) return str; + ++i; + // fromCharCode constructs a character from a UTF-16 code unit, so we can pass the UTF16 string right through. + str += String.fromCharCode(codeUnit); + } + } +} + +// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', +// null-terminated and encoded in UTF16 form. The copy will require at most str.length*4+2 bytes of space in the HEAP. +// Use the function lengthBytesUTF16() to compute the exact number of bytes (excluding null terminator) that this function will write. +// Parameters: +// str: the Javascript string to copy. +// outPtr: Byte address in Emscripten HEAP where to write the string to. +// maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null +// terminator, i.e. if maxBytesToWrite=2, only the null terminator will be written and nothing else. +// maxBytesToWrite<2 does not write any bytes to the output, not even the null terminator. +// Returns the number of bytes written, EXCLUDING the null terminator. + +function stringToUTF16(str, outPtr, maxBytesToWrite) { + // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed. + if (maxBytesToWrite === undefined) { + maxBytesToWrite = 0x7fffffff; + } + if (maxBytesToWrite < 2) return 0; + maxBytesToWrite -= 2; // Null terminator. + var startPtr = outPtr; + var numCharsToWrite = + maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length; + for (var i = 0; i < numCharsToWrite; ++i) { + // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP. + var codeUnit = str.charCodeAt(i); // possibly a lead surrogate + HEAP16[outPtr >> 1] = codeUnit; + outPtr += 2; + } + // Null-terminate the pointer to the HEAP. + HEAP16[outPtr >> 1] = 0; + return outPtr - startPtr; +} + +// Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte. + +function lengthBytesUTF16(str) { + return str.length * 2; +} + +function UTF32ToString(ptr) { + var i = 0; + + var str = ""; + while (1) { + var utf32 = HEAP32[(ptr + i * 4) >> 2]; + if (utf32 == 0) return str; + ++i; + // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + if (utf32 >= 0x10000) { + var ch = utf32 - 0x10000; + str += String.fromCharCode(0xd800 | (ch >> 10), 0xdc00 | (ch & 0x3ff)); + } else { + str += String.fromCharCode(utf32); + } + } +} + +// Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', +// null-terminated and encoded in UTF32 form. The copy will require at most str.length*4+4 bytes of space in the HEAP. +// Use the function lengthBytesUTF32() to compute the exact number of bytes (excluding null terminator) that this function will write. +// Parameters: +// str: the Javascript string to copy. +// outPtr: Byte address in Emscripten HEAP where to write the string to. +// maxBytesToWrite: The maximum number of bytes this function can write to the array. This count should include the null +// terminator, i.e. if maxBytesToWrite=4, only the null terminator will be written and nothing else. +// maxBytesToWrite<4 does not write any bytes to the output, not even the null terminator. +// Returns the number of bytes written, EXCLUDING the null terminator. + +function stringToUTF32(str, outPtr, maxBytesToWrite) { + // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed. + if (maxBytesToWrite === undefined) { + maxBytesToWrite = 0x7fffffff; + } + if (maxBytesToWrite < 4) return 0; + var startPtr = outPtr; + var endPtr = startPtr + maxBytesToWrite - 4; + for (var i = 0; i < str.length; ++i) { + // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + var codeUnit = str.charCodeAt(i); // possibly a lead surrogate + if (codeUnit >= 0xd800 && codeUnit <= 0xdfff) { + var trailSurrogate = str.charCodeAt(++i); + codeUnit = + (0x10000 + ((codeUnit & 0x3ff) << 10)) | (trailSurrogate & 0x3ff); + } + HEAP32[outPtr >> 2] = codeUnit; + outPtr += 4; + if (outPtr + 4 > endPtr) break; + } + // Null-terminate the pointer to the HEAP. + HEAP32[outPtr >> 2] = 0; + return outPtr - startPtr; +} + +// Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte. + +function lengthBytesUTF32(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap. + // See http://unicode.org/faq/utf_bom.html#utf16-3 + var codeUnit = str.charCodeAt(i); + if (codeUnit >= 0xd800 && codeUnit <= 0xdfff) ++i; // possibly a lead surrogate, so skip over the tail surrogate. + len += 4; + } + + return len; +} + +function demangle(func) { + var __cxa_demangle_func = + Module["___cxa_demangle"] || Module["__cxa_demangle"]; + if (__cxa_demangle_func) { + try { + var s = func.substr(1); + var len = lengthBytesUTF8(s) + 1; + var buf = _malloc(len); + stringToUTF8(s, buf, len); + var status = _malloc(4); + var ret = __cxa_demangle_func(buf, 0, 0, status); + if (getValue(status, "i32") === 0 && ret) { + return Pointer_stringify(ret); + } + // otherwise, libcxxabi failed + } catch (e) { + // ignore problems here + } finally { + if (buf) _free(buf); + if (status) _free(status); + if (ret) _free(ret); + } + // failure when using libcxxabi, don't demangle + return func; + } + Runtime.warnOnce( + "warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling" + ); + return func; +} + +function demangleAll(text) { + var regex = /__Z[\w\d_]+/g; + return text.replace(regex, function(x) { + var y = demangle(x); + return x === y ? x : x + " [" + y + "]"; + }); +} + +function jsStackTrace() { + var err = new Error(); + if (!err.stack) { + // IE10+ special cases: It does have callstack info, but it is only populated if an Error object is thrown, + // so try that as a special-case. + try { + throw new Error(0); + } catch (e) { + err = e; + } + if (!err.stack) { + return "(no stack trace available)"; + } + } + return err.stack.toString(); +} + +function stackTrace() { + var js = jsStackTrace(); + if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); + return demangleAll(js); +} +Module["stackTrace"] = stackTrace; + +// Memory management + +var PAGE_SIZE = 16384; +var WASM_PAGE_SIZE = 65536; +var ASMJS_PAGE_SIZE = 16777216; +var MIN_TOTAL_MEMORY = 16777216; + +function alignUp(x, multiple) { + if (x % multiple > 0) { + x += multiple - x % multiple; + } + return x; +} + +var HEAP, + /** @type {ArrayBuffer} */ + buffer, + /** @type {Int8Array} */ + HEAP8, + /** @type {Uint8Array} */ + HEAPU8, + /** @type {Int16Array} */ + HEAP16, + /** @type {Uint16Array} */ + HEAPU16, + /** @type {Int32Array} */ + HEAP32, + /** @type {Uint32Array} */ + HEAPU32, + /** @type {Float32Array} */ + HEAPF32, + /** @type {Float64Array} */ + HEAPF64; + +function updateGlobalBuffer(buf) { + Module["buffer"] = buffer = buf; +} + +function updateGlobalBufferViews() { + Module["HEAP8"] = HEAP8 = new Int8Array(buffer); + Module["HEAP16"] = HEAP16 = new Int16Array(buffer); + Module["HEAP32"] = HEAP32 = new Int32Array(buffer); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(buffer); + Module["HEAPU16"] = HEAPU16 = new Uint16Array(buffer); + Module["HEAPU32"] = HEAPU32 = new Uint32Array(buffer); + Module["HEAPF32"] = HEAPF32 = new Float32Array(buffer); + Module["HEAPF64"] = HEAPF64 = new Float64Array(buffer); +} + +var STATIC_BASE, STATICTOP, staticSealed; // static area +var STACK_BASE, STACKTOP, STACK_MAX; // stack area +var DYNAMIC_BASE, DYNAMICTOP_PTR; // dynamic area handled by sbrk + +STATIC_BASE = STATICTOP = STACK_BASE = STACKTOP = STACK_MAX = DYNAMIC_BASE = DYNAMICTOP_PTR = 0; +staticSealed = false; + +function abortOnCannotGrowMemory() { + abort( + "Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value " + + TOTAL_MEMORY + + ", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 " + ); +} + +function enlargeMemory() { + abortOnCannotGrowMemory(); +} + +var TOTAL_STACK = Module["TOTAL_STACK"] || 5242880; +var TOTAL_MEMORY = Module["TOTAL_MEMORY"] || 16777216; +if (TOTAL_MEMORY < TOTAL_STACK) + Module.printErr( + "TOTAL_MEMORY should be larger than TOTAL_STACK, was " + + TOTAL_MEMORY + + "! (TOTAL_STACK=" + + TOTAL_STACK + + ")" + ); + +// Initialize the runtime's memory + +// Use a provided buffer, if there is one, or else allocate a new one +if (Module["buffer"]) { + buffer = Module["buffer"]; +} else { + // Use a WebAssembly memory where available + if ( + typeof WebAssembly === "object" && + typeof WebAssembly.Memory === "function" + ) { + Module["wasmMemory"] = new WebAssembly.Memory({ + initial: TOTAL_MEMORY / WASM_PAGE_SIZE, + maximum: TOTAL_MEMORY / WASM_PAGE_SIZE + }); + buffer = Module["wasmMemory"].buffer; + } else { + buffer = new ArrayBuffer(TOTAL_MEMORY); + } +} +updateGlobalBufferViews(); + +function getTotalMemory() { + return TOTAL_MEMORY; +} + +// Endianness check (note: assumes compiler arch was little-endian) +HEAP32[0] = 0x63736d65; /* 'emsc' */ +HEAP16[1] = 0x6373; +if (HEAPU8[2] !== 0x73 || HEAPU8[3] !== 0x63) + throw "Runtime error: expected the system to be little-endian!"; + +Module["HEAP"] = HEAP; +Module["buffer"] = buffer; +Module["HEAP8"] = HEAP8; +Module["HEAP16"] = HEAP16; +Module["HEAP32"] = HEAP32; +Module["HEAPU8"] = HEAPU8; +Module["HEAPU16"] = HEAPU16; +Module["HEAPU32"] = HEAPU32; +Module["HEAPF32"] = HEAPF32; +Module["HEAPF64"] = HEAPF64; + +function callRuntimeCallbacks(callbacks) { + while (callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == "function") { + callback(); + continue; + } + var func = callback.func; + if (typeof func === "number") { + if (callback.arg === undefined) { + Module["dynCall_v"](func); + } else { + Module["dynCall_vi"](func, callback.arg); + } + } else { + func(callback.arg === undefined ? null : callback.arg); + } + } +} + +var __ATPRERUN__ = []; // functions called before the runtime is initialized +var __ATINIT__ = []; // functions called during startup +var __ATMAIN__ = []; // functions called when main() is to be run +var __ATEXIT__ = []; // functions called during shutdown +var __ATPOSTRUN__ = []; // functions called after the runtime has exited + +var runtimeInitialized = false; +var runtimeExited = false; + +function preRun() { + // compatibility - merge in anything from Module['preRun'] at this time + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") + Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()); + } + } + callRuntimeCallbacks(__ATPRERUN__); +} + +function ensureInitRuntime() { + if (runtimeInitialized) return; + runtimeInitialized = true; + callRuntimeCallbacks(__ATINIT__); +} + +function preMain() { + callRuntimeCallbacks(__ATMAIN__); +} + +function exitRuntime() { + callRuntimeCallbacks(__ATEXIT__); + runtimeExited = true; +} + +function postRun() { + // compatibility - merge in anything from Module['postRun'] at this time + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") + Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()); + } + } + callRuntimeCallbacks(__ATPOSTRUN__); +} + +function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb); +} +Module["addOnPreRun"] = addOnPreRun; + +function addOnInit(cb) { + __ATINIT__.unshift(cb); +} +Module["addOnInit"] = addOnInit; + +function addOnPreMain(cb) { + __ATMAIN__.unshift(cb); +} +Module["addOnPreMain"] = addOnPreMain; + +function addOnExit(cb) { + __ATEXIT__.unshift(cb); +} +Module["addOnExit"] = addOnExit; + +function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb); +} +Module["addOnPostRun"] = addOnPostRun; + +// Tools + +/** @type {function(string, boolean=, number=)} */ +function intArrayFromString(stringy, dontAddNull, length) { + var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1; + var u8array = new Array(len); + var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length); + if (dontAddNull) u8array.length = numBytesWritten; + return u8array; +} +Module["intArrayFromString"] = intArrayFromString; + +function intArrayToString(array) { + var ret = []; + for (var i = 0; i < array.length; i++) { + var chr = array[i]; + if (chr > 0xff) { + chr &= 0xff; + } + ret.push(String.fromCharCode(chr)); + } + return ret.join(""); +} +Module["intArrayToString"] = intArrayToString; + +// Deprecated: This function should not be called because it is unsafe and does not provide +// a maximum length limit of how many bytes it is allowed to write. Prefer calling the +// function stringToUTF8Array() instead, which takes in a maximum length that can be used +// to be secure from out of bounds writes. +/** @deprecated */ +function writeStringToMemory(string, buffer, dontAddNull) { + Runtime.warnOnce( + "writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!" + ); + + var /** @type {number} */ lastChar, /** @type {number} */ end; + if (dontAddNull) { + // stringToUTF8Array always appends null. If we don't want to do that, remember the + // character that existed at the location where the null will be placed, and restore + // that after the write (below). + end = buffer + lengthBytesUTF8(string); + lastChar = HEAP8[end]; + } + stringToUTF8(string, buffer, Infinity); + if (dontAddNull) HEAP8[end] = lastChar; // Restore the value under the null character. +} +Module["writeStringToMemory"] = writeStringToMemory; + +function writeArrayToMemory(array, buffer) { + HEAP8.set(array, buffer); +} +Module["writeArrayToMemory"] = writeArrayToMemory; + +function writeAsciiToMemory(str, buffer, dontAddNull) { + for (var i = 0; i < str.length; ++i) { + HEAP8[buffer++ >> 0] = str.charCodeAt(i); + } + // Null-terminate the pointer to the HEAP. + if (!dontAddNull) HEAP8[buffer >> 0] = 0; +} +Module["writeAsciiToMemory"] = writeAsciiToMemory; + +function unSign(value, bits, ignore) { + if (value >= 0) { + return value; + } + return bits <= 32 + ? 2 * Math.abs(1 << (bits - 1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts + : Math.pow(2, bits) + value; +} +function reSign(value, bits, ignore) { + if (value <= 0) { + return value; + } + var half = + bits <= 32 + ? Math.abs(1 << (bits - 1)) // abs is needed if bits == 32 + : Math.pow(2, bits - 1); + if (value >= half && (bits <= 32 || value > half)) { + // for huge values, we can hit the precision limit and always get true here. so don't do that + // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors + // TODO: In i64 mode 1, resign the two parts separately and safely + value = -2 * half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts + } + return value; +} + +// check for imul support, and also for correctness ( https://bugs.webkit.org/show_bug.cgi?id=126345 ) +if (!Math["imul"] || Math["imul"](0xffffffff, 5) !== -5) + Math["imul"] = function imul(a, b) { + var ah = a >>> 16; + var al = a & 0xffff; + var bh = b >>> 16; + var bl = b & 0xffff; + return (al * bl + ((ah * bl + al * bh) << 16)) | 0; + }; +Math.imul = Math["imul"]; + +if (!Math["fround"]) { + var froundBuffer = new Float32Array(1); + Math["fround"] = function(x) { + froundBuffer[0] = x; + return froundBuffer[0]; + }; +} +Math.fround = Math["fround"]; + +if (!Math["clz32"]) + Math["clz32"] = function(x) { + x = x >>> 0; + for (var i = 0; i < 32; i++) { + if (x & (1 << (31 - i))) return i; + } + return 32; + }; +Math.clz32 = Math["clz32"]; + +if (!Math["trunc"]) + Math["trunc"] = function(x) { + return x < 0 ? Math.ceil(x) : Math.floor(x); + }; +Math.trunc = Math["trunc"]; + +var Math_abs = Math.abs; +var Math_cos = Math.cos; +var Math_sin = Math.sin; +var Math_tan = Math.tan; +var Math_acos = Math.acos; +var Math_asin = Math.asin; +var Math_atan = Math.atan; +var Math_atan2 = Math.atan2; +var Math_exp = Math.exp; +var Math_log = Math.log; +var Math_sqrt = Math.sqrt; +var Math_ceil = Math.ceil; +var Math_floor = Math.floor; +var Math_pow = Math.pow; +var Math_imul = Math.imul; +var Math_fround = Math.fround; +var Math_round = Math.round; +var Math_min = Math.min; +var Math_clz32 = Math.clz32; +var Math_trunc = Math.trunc; + +// A counter of dependencies for calling run(). If we need to +// do asynchronous work before running, increment this and +// decrement it. Incrementing must happen in a place like +// PRE_RUN_ADDITIONS (used by emcc to add file preloading). +// Note that you can add dependencies in preRun, even though +// it happens right before run - run will be postponed until +// the dependencies are met. +var runDependencies = 0; +var runDependencyWatcher = null; +var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled + +function getUniqueRunDependency(id) { + return id; +} + +function addRunDependency(id) { + runDependencies++; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies); + } +} +Module["addRunDependency"] = addRunDependency; + +function removeRunDependency(id) { + runDependencies--; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies); + } + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); // can add another dependenciesFulfilled + } + } +} +Module["removeRunDependency"] = removeRunDependency; + +Module["preloadedImages"] = {}; // maps url to image data +Module["preloadedAudios"] = {}; // maps url to audio data + +var memoryInitializer = null; + +function integrateWasmJS(Module) { + // wasm.js has several methods for creating the compiled code module here: + // * 'native-wasm' : use native WebAssembly support in the browser + // * 'interpret-s-expr': load s-expression code from a .wast and interpret + // * 'interpret-binary': load binary wasm and interpret + // * 'interpret-asm2wasm': load asm.js code, translate to wasm, and interpret + // * 'asmjs': no wasm, just load the asm.js code and use that (good for testing) + // The method can be set at compile time (BINARYEN_METHOD), or runtime by setting Module['wasmJSMethod']. + // The method can be a comma-separated list, in which case, we will try the + // options one by one. Some of them can fail gracefully, and then we can try + // the next. + + // inputs + + var method = Module["wasmJSMethod"] || "native-wasm"; + Module["wasmJSMethod"] = method; + + var wasmTextFile = Module["wasmTextFile"] || "average.wast"; + var wasmBinaryFile = Module["wasmBinaryFile"] || "average.wasm"; + var asmjsCodeFile = Module["asmjsCodeFile"] || "average.temp.asm.js"; + + if (typeof Module["locateFile"] === "function") { + wasmTextFile = Module["locateFile"](wasmTextFile); + wasmBinaryFile = Module["locateFile"](wasmBinaryFile); + asmjsCodeFile = Module["locateFile"](asmjsCodeFile); + } + + // utilities + + var wasmPageSize = 64 * 1024; + + var asm2wasmImports = { + // special asm2wasm imports + "f64-rem": function(x, y) { + return x % y; + }, + "f64-to-int": function(x) { + return x | 0; + }, + "i32s-div": function(x, y) { + return ((x | 0) / (y | 0)) | 0; + }, + "i32u-div": function(x, y) { + return ((x >>> 0) / (y >>> 0)) >>> 0; + }, + "i32s-rem": function(x, y) { + return ((x | 0) % (y | 0)) | 0; + }, + "i32u-rem": function(x, y) { + return ((x >>> 0) % (y >>> 0)) >>> 0; + }, + debugger: function() { + debugger; + } + }; + + var info = { + global: null, + env: null, + asm2wasm: asm2wasmImports, + parent: Module // Module inside wasm-js.cpp refers to wasm-js.cpp; this allows access to the outside program. + }; + + var exports = null; + + function lookupImport(mod, base) { + var lookup = info; + if (mod.indexOf(".") < 0) { + lookup = (lookup || {})[mod]; + } else { + var parts = mod.split("."); + lookup = (lookup || {})[parts[0]]; + lookup = (lookup || {})[parts[1]]; + } + if (base) { + lookup = (lookup || {})[base]; + } + if (lookup === undefined) { + abort("bad lookupImport to (" + mod + ")." + base); + } + return lookup; + } + + function mergeMemory(newBuffer) { + // The wasm instance creates its memory. But static init code might have written to + // buffer already, including the mem init file, and we must copy it over in a proper merge. + // TODO: avoid this copy, by avoiding such static init writes + // TODO: in shorter term, just copy up to the last static init write + var oldBuffer = Module["buffer"]; + if (newBuffer.byteLength < oldBuffer.byteLength) { + Module["printErr"]( + "the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here" + ); + } + var oldView = new Int8Array(oldBuffer); + var newView = new Int8Array(newBuffer); + + // If we have a mem init file, do not trample it + if (!memoryInitializer) { + oldView.set( + newView.subarray( + Module["STATIC_BASE"], + Module["STATIC_BASE"] + Module["STATIC_BUMP"] + ), + Module["STATIC_BASE"] + ); + } + + newView.set(oldView); + updateGlobalBuffer(newBuffer); + updateGlobalBufferViews(); + } + + var WasmTypes = { + none: 0, + i32: 1, + i64: 2, + f32: 3, + f64: 4 + }; + + function fixImports(imports) { + if (!0) return imports; + var ret = {}; + for (var i in imports) { + var fixed = i; + if (fixed[0] == "_") fixed = fixed.substr(1); + ret[fixed] = imports[i]; + } + return ret; + } + + function getBinary() { + try { + var binary; + if (Module["wasmBinary"]) { + binary = Module["wasmBinary"]; + binary = new Uint8Array(binary); + } else if (Module["readBinary"]) { + binary = Module["readBinary"](wasmBinaryFile); + } else { + throw "on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)"; + } + return binary; + } catch (err) { + abort(err); + } + } + + function getBinaryPromise() { + // if we don't have the binary yet, and have the Fetch api, use that + if (!Module["wasmBinary"] && typeof fetch === "function") { + return fetch(wasmBinaryFile, { + credentials: "same-origin" + }).then(function(response) { + if (!response["ok"]) { + throw "failed to load wasm binary file at '" + wasmBinaryFile + "'"; + } + return response["arrayBuffer"](); + }); + } + // Otherwise, getBinary should be able to get it synchronously + return new Promise(function(resolve, reject) { + resolve(getBinary()); + }); + } + + // do-method functions + + function doJustAsm(global, env, providedBuffer) { + // if no Module.asm, or it's the method handler helper (see below), then apply + // the asmjs + if ( + typeof Module["asm"] !== "function" || + Module["asm"] === methodHandler + ) { + if (!Module["asmPreload"]) { + // you can load the .asm.js file before this, to avoid this sync xhr and eval + eval(Module["read"](asmjsCodeFile)); // set Module.asm + } else { + Module["asm"] = Module["asmPreload"]; + } + } + if (typeof Module["asm"] !== "function") { + Module["printErr"]("asm evalling did not set the module properly"); + return false; + } + return Module["asm"](global, env, providedBuffer); + } + + function doNativeWasm(global, env, providedBuffer) { + if (typeof WebAssembly !== "object") { + Module["printErr"]("no native wasm support detected"); + return false; + } + // prepare memory import + if (!(Module["wasmMemory"] instanceof WebAssembly.Memory)) { + Module["printErr"]("no native wasm Memory in use"); + return false; + } + env["memory"] = Module["wasmMemory"]; + // Load the wasm module and create an instance of using native support in the JS engine. + info["global"] = { + NaN: NaN, + Infinity: Infinity + }; + info["global.Math"] = global.Math; + info["env"] = env; + // handle a generated wasm instance, receiving its exports and + // performing other necessary setup + function receiveInstance(instance) { + exports = instance.exports; + if (exports.memory) mergeMemory(exports.memory); + Module["asm"] = exports; + Module["usingWasm"] = true; + removeRunDependency("wasm-instantiate"); + } + + addRunDependency("wasm-instantiate"); // we can't run yet + + // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback + // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel + // to any other async startup actions they are performing. + if (Module["instantiateWasm"]) { + try { + return Module["instantiateWasm"](info, receiveInstance); + } catch (e) { + Module["printErr"]( + "Module.instantiateWasm callback failed with error: " + e + ); + return false; + } + } + + getBinaryPromise() + .then(function(binary) { + return WebAssembly.instantiate(binary, info); + }) + .then(function(output) { + // receiveInstance() will swap in the exports (to Module.asm) so they can be called + receiveInstance(output["instance"]); + }) + .catch(function(reason) { + Module["printErr"]("failed to asynchronously prepare wasm: " + reason); + abort(reason); + }); + return {}; // no exports yet; we'll fill them in later + } + + function doWasmPolyfill(global, env, providedBuffer, method) { + if (typeof WasmJS !== "function") { + Module["printErr"]("WasmJS not detected - polyfill not bundled?"); + return false; + } + + // Use wasm.js to polyfill and execute code in a wasm interpreter. + var wasmJS = WasmJS({}); + + // XXX don't be confused. Module here is in the outside program. wasmJS is the inner wasm-js.cpp. + wasmJS["outside"] = Module; // Inside wasm-js.cpp, Module['outside'] reaches the outside module. + + // Information for the instance of the module. + wasmJS["info"] = info; + + wasmJS["lookupImport"] = lookupImport; + + assert(providedBuffer === Module["buffer"]); // we should not even need to pass it as a 3rd arg for wasm, but that's the asm.js way. + + info.global = global; + info.env = env; + + // polyfill interpreter expects an ArrayBuffer + assert(providedBuffer === Module["buffer"]); + env["memory"] = providedBuffer; + assert(env["memory"] instanceof ArrayBuffer); + + wasmJS["providedTotalMemory"] = Module["buffer"].byteLength; + + // Prepare to generate wasm, using either asm2wasm or s-exprs + var code; + if (method === "interpret-binary") { + code = getBinary(); + } else { + code = Module["read"]( + method == "interpret-asm2wasm" ? asmjsCodeFile : wasmTextFile + ); + } + var temp; + if (method == "interpret-asm2wasm") { + temp = wasmJS["_malloc"](code.length + 1); + wasmJS["writeAsciiToMemory"](code, temp); + wasmJS["_load_asm2wasm"](temp); + } else if (method === "interpret-s-expr") { + temp = wasmJS["_malloc"](code.length + 1); + wasmJS["writeAsciiToMemory"](code, temp); + wasmJS["_load_s_expr2wasm"](temp); + } else if (method === "interpret-binary") { + temp = wasmJS["_malloc"](code.length); + wasmJS["HEAPU8"].set(code, temp); + wasmJS["_load_binary2wasm"](temp, code.length); + } else { + throw "what? " + method; + } + wasmJS["_free"](temp); + + wasmJS["_instantiate"](temp); + + if (Module["newBuffer"]) { + mergeMemory(Module["newBuffer"]); + Module["newBuffer"] = null; + } + + exports = wasmJS["asmExports"]; + + return exports; + } + + // We may have a preloaded value in Module.asm, save it + Module["asmPreload"] = Module["asm"]; + + // Memory growth integration code + + var asmjsReallocBuffer = Module["reallocBuffer"]; + + var wasmReallocBuffer = function(size) { + var PAGE_MULTIPLE = Module["usingWasm"] ? WASM_PAGE_SIZE : ASMJS_PAGE_SIZE; // In wasm, heap size must be a multiple of 64KB. In asm.js, they need to be multiples of 16MB. + size = alignUp(size, PAGE_MULTIPLE); // round up to wasm page size + var old = Module["buffer"]; + var oldSize = old.byteLength; + if (Module["usingWasm"]) { + // native wasm support + try { + var result = Module["wasmMemory"].grow((size - oldSize) / wasmPageSize); // .grow() takes a delta compared to the previous size + if (result !== (-1 | 0)) { + // success in native wasm memory growth, get the buffer from the memory + return (Module["buffer"] = Module["wasmMemory"].buffer); + } else { + return null; + } + } catch (e) { + return null; + } + } else { + // wasm interpreter support + exports["__growWasmMemory"]((size - oldSize) / wasmPageSize); // tiny wasm method that just does grow_memory + // in interpreter, we replace Module.buffer if we allocate + return Module["buffer"] !== old ? Module["buffer"] : null; // if it was reallocated, it changed + } + }; + + Module["reallocBuffer"] = function(size) { + if (finalMethod === "asmjs") { + return asmjsReallocBuffer(size); + } else { + return wasmReallocBuffer(size); + } + }; + + // we may try more than one; this is the final one, that worked and we are using + var finalMethod = ""; + + // Provide an "asm.js function" for the application, called to "link" the asm.js module. We instantiate + // the wasm module at that time, and it receives imports and provides exports and so forth, the app + // doesn't need to care that it is wasm or olyfilled wasm or asm.js. + + Module["asm"] = function(global, env, providedBuffer) { + global = fixImports(global); + env = fixImports(env); + + // import table + if (!env["table"]) { + var TABLE_SIZE = Module["wasmTableSize"]; + if (TABLE_SIZE === undefined) TABLE_SIZE = 1024; // works in binaryen interpreter at least + var MAX_TABLE_SIZE = Module["wasmMaxTableSize"]; + if ( + typeof WebAssembly === "object" && + typeof WebAssembly.Table === "function" + ) { + if (MAX_TABLE_SIZE !== undefined) { + env["table"] = new WebAssembly.Table({ + initial: TABLE_SIZE, + maximum: MAX_TABLE_SIZE, + element: "anyfunc" + }); + } else { + env["table"] = new WebAssembly.Table({ + initial: TABLE_SIZE, + element: "anyfunc" + }); + } + } else { + env["table"] = new Array(TABLE_SIZE); // works in binaryen interpreter at least + } + Module["wasmTable"] = env["table"]; + } + + if (!env["memoryBase"]) { + env["memoryBase"] = Module["STATIC_BASE"]; // tell the memory segments where to place themselves + } + if (!env["tableBase"]) { + env["tableBase"] = 0; // table starts at 0 by default, in dynamic linking this will change + } + + // try the methods. each should return the exports if it succeeded + + var exports; + exports = doNativeWasm(global, env, providedBuffer); + + return exports; + }; + + var methodHandler = Module["asm"]; // note our method handler, as we may modify Module['asm'] later +} + +integrateWasmJS(Module); + +// === Body === + +var ASM_CONSTS = []; + +STATIC_BASE = Runtime.GLOBAL_BASE; + +STATICTOP = STATIC_BASE + 3008; +/* global initializers */ __ATINIT__.push(); + +memoryInitializer = + Module["wasmJSMethod"].indexOf("asmjs") >= 0 || + Module["wasmJSMethod"].indexOf("interpret-asm2wasm") >= 0 + ? "average.js.mem" + : null; + +var STATIC_BUMP = 3008; +Module["STATIC_BASE"] = STATIC_BASE; +Module["STATIC_BUMP"] = STATIC_BUMP; + +/* no memory initializer */ +var tempDoublePtr = STATICTOP; +STATICTOP += 16; + +function copyTempFloat(ptr) { + // functions, because inlining this code increases code size too much + + HEAP8[tempDoublePtr] = HEAP8[ptr]; + + HEAP8[tempDoublePtr + 1] = HEAP8[ptr + 1]; + + HEAP8[tempDoublePtr + 2] = HEAP8[ptr + 2]; + + HEAP8[tempDoublePtr + 3] = HEAP8[ptr + 3]; +} + +function copyTempDouble(ptr) { + HEAP8[tempDoublePtr] = HEAP8[ptr]; + + HEAP8[tempDoublePtr + 1] = HEAP8[ptr + 1]; + + HEAP8[tempDoublePtr + 2] = HEAP8[ptr + 2]; + + HEAP8[tempDoublePtr + 3] = HEAP8[ptr + 3]; + + HEAP8[tempDoublePtr + 4] = HEAP8[ptr + 4]; + + HEAP8[tempDoublePtr + 5] = HEAP8[ptr + 5]; + + HEAP8[tempDoublePtr + 6] = HEAP8[ptr + 6]; + + HEAP8[tempDoublePtr + 7] = HEAP8[ptr + 7]; +} + +// {{PRE_LIBRARY}} + +function ___setErrNo(value) { + if (Module["___errno_location"]) + HEAP32[Module["___errno_location"]() >> 2] = value; + return value; +} + +function ___lock() {} + +function _emscripten_memcpy_big(dest, src, num) { + HEAPU8.set(HEAPU8.subarray(src, src + num), dest); + return dest; +} + +function _abort() { + Module["abort"](); +} + +var SYSCALLS = { + varargs: 0, + get: function(varargs) { + SYSCALLS.varargs += 4; + var ret = HEAP32[(SYSCALLS.varargs - 4) >> 2]; + return ret; + }, + getStr: function() { + var ret = Pointer_stringify(SYSCALLS.get()); + return ret; + }, + get64: function() { + var low = SYSCALLS.get(), + high = SYSCALLS.get(); + if (low >= 0) assert(high === 0); + else assert(high === -1); + return low; + }, + getZero: function() { + assert(SYSCALLS.get() === 0); + } +}; +function ___syscall140(which, varargs) { + SYSCALLS.varargs = varargs; + try { + // llseek + var stream = SYSCALLS.getStreamFromFD(), + offset_high = SYSCALLS.get(), + offset_low = SYSCALLS.get(), + result = SYSCALLS.get(), + whence = SYSCALLS.get(); + // NOTE: offset_high is unused - Emscripten's off_t is 32-bit + var offset = offset_low; + FS.llseek(stream, offset, whence); + HEAP32[result >> 2] = stream.position; + if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; // reset readdir state + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} + +function ___syscall146(which, varargs) { + SYSCALLS.varargs = varargs; + try { + // writev + // hack to support printf in NO_FILESYSTEM + var stream = SYSCALLS.get(), + iov = SYSCALLS.get(), + iovcnt = SYSCALLS.get(); + var ret = 0; + if (!___syscall146.buffer) { + ___syscall146.buffers = [null, [], []]; // 1 => stdout, 2 => stderr + ___syscall146.printChar = function(stream, curr) { + var buffer = ___syscall146.buffers[stream]; + assert(buffer); + if (curr === 0 || curr === 10) { + (stream === 1 ? Module["print"] : Module["printErr"])( + UTF8ArrayToString(buffer, 0) + ); + buffer.length = 0; + } else { + buffer.push(curr); + } + }; + } + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[(iov + i * 8) >> 2]; + var len = HEAP32[(iov + (i * 8 + 4)) >> 2]; + for (var j = 0; j < len; j++) { + ___syscall146.printChar(stream, HEAPU8[ptr + j]); + } + ret += len; + } + return ret; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} + +function ___syscall54(which, varargs) { + SYSCALLS.varargs = varargs; + try { + // ioctl + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} + +function ___unlock() {} + +function ___syscall6(which, varargs) { + SYSCALLS.varargs = varargs; + try { + // close + var stream = SYSCALLS.getStreamFromFD(); + FS.close(stream); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +/* flush anything remaining in the buffer during shutdown */ __ATEXIT__.push( + function() { + var fflush = Module["_fflush"]; + if (fflush) fflush(0); + var printChar = ___syscall146.printChar; + if (!printChar) return; + var buffers = ___syscall146.buffers; + if (buffers[1].length) printChar(1, 10); + if (buffers[2].length) printChar(2, 10); + } +); +DYNAMICTOP_PTR = allocate(1, "i32", ALLOC_STATIC); + +STACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP); + +STACK_MAX = STACK_BASE + TOTAL_STACK; + +DYNAMIC_BASE = Runtime.alignMemory(STACK_MAX); + +HEAP32[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE; + +staticSealed = true; // seal the static portion of memory + +Module["wasmTableSize"] = 6; + +Module["wasmMaxTableSize"] = 6; + +function invoke_ii(index, a1) { + try { + return Module["dynCall_ii"](index, a1); + } catch (e) { + if (typeof e !== "number" && e !== "longjmp") throw e; + Module["setThrew"](1, 0); + } +} + +function invoke_iiii(index, a1, a2, a3) { + try { + return Module["dynCall_iiii"](index, a1, a2, a3); + } catch (e) { + if (typeof e !== "number" && e !== "longjmp") throw e; + Module["setThrew"](1, 0); + } +} + +Module.asmGlobalArg = { + Math: Math, + Int8Array: Int8Array, + Int16Array: Int16Array, + Int32Array: Int32Array, + Uint8Array: Uint8Array, + Uint16Array: Uint16Array, + Uint32Array: Uint32Array, + Float32Array: Float32Array, + Float64Array: Float64Array, + NaN: NaN, + Infinity: Infinity +}; + +Module.asmLibraryArg = { + abort: abort, + assert: assert, + enlargeMemory: enlargeMemory, + getTotalMemory: getTotalMemory, + abortOnCannotGrowMemory: abortOnCannotGrowMemory, + invoke_ii: invoke_ii, + invoke_iiii: invoke_iiii, + ___lock: ___lock, + ___syscall6: ___syscall6, + ___setErrNo: ___setErrNo, + _abort: _abort, + ___syscall140: ___syscall140, + _emscripten_memcpy_big: _emscripten_memcpy_big, + ___syscall54: ___syscall54, + ___unlock: ___unlock, + ___syscall146: ___syscall146, + DYNAMICTOP_PTR: DYNAMICTOP_PTR, + tempDoublePtr: tempDoublePtr, + ABORT: ABORT, + STACKTOP: STACKTOP, + STACK_MAX: STACK_MAX +}; +// EMSCRIPTEN_START_ASM +var asm = Module["asm"]( + // EMSCRIPTEN_END_ASM + Module.asmGlobalArg, + Module.asmLibraryArg, + buffer +); + +Module["asm"] = asm; +var _malloc = (Module["_malloc"] = function() { + return Module["asm"]["_malloc"].apply(null, arguments); +}); +var getTempRet0 = (Module["getTempRet0"] = function() { + return Module["asm"]["getTempRet0"].apply(null, arguments); +}); +var _free = (Module["_free"] = function() { + return Module["asm"]["_free"].apply(null, arguments); +}); +var runPostSets = (Module["runPostSets"] = function() { + return Module["asm"]["runPostSets"].apply(null, arguments); +}); +var setTempRet0 = (Module["setTempRet0"] = function() { + return Module["asm"]["setTempRet0"].apply(null, arguments); +}); +var _average = (Module["_average"] = function() { + return Module["asm"]["_average"].apply(null, arguments); +}); +var stackSave = (Module["stackSave"] = function() { + return Module["asm"]["stackSave"].apply(null, arguments); +}); +var _memset = (Module["_memset"] = function() { + return Module["asm"]["_memset"].apply(null, arguments); +}); +var _sbrk = (Module["_sbrk"] = function() { + return Module["asm"]["_sbrk"].apply(null, arguments); +}); +var establishStackSpace = (Module["establishStackSpace"] = function() { + return Module["asm"]["establishStackSpace"].apply(null, arguments); +}); +var _emscripten_get_global_libc = (Module[ + "_emscripten_get_global_libc" +] = function() { + return Module["asm"]["_emscripten_get_global_libc"].apply(null, arguments); +}); +var _memcpy = (Module["_memcpy"] = function() { + return Module["asm"]["_memcpy"].apply(null, arguments); +}); +var _sum = (Module["_sum"] = function() { + return Module["asm"]["_sum"].apply(null, arguments); +}); +var stackAlloc = (Module["stackAlloc"] = function() { + return Module["asm"]["stackAlloc"].apply(null, arguments); +}); +var setThrew = (Module["setThrew"] = function() { + return Module["asm"]["setThrew"].apply(null, arguments); +}); +var _fflush = (Module["_fflush"] = function() { + return Module["asm"]["_fflush"].apply(null, arguments); +}); +var stackRestore = (Module["stackRestore"] = function() { + return Module["asm"]["stackRestore"].apply(null, arguments); +}); +var ___errno_location = (Module["___errno_location"] = function() { + return Module["asm"]["___errno_location"].apply(null, arguments); +}); +var dynCall_ii = (Module["dynCall_ii"] = function() { + return Module["asm"]["dynCall_ii"].apply(null, arguments); +}); +var dynCall_iiii = (Module["dynCall_iiii"] = function() { + return Module["asm"]["dynCall_iiii"].apply(null, arguments); +}); +Runtime.stackAlloc = Module["stackAlloc"]; +Runtime.stackSave = Module["stackSave"]; +Runtime.stackRestore = Module["stackRestore"]; +Runtime.establishStackSpace = Module["establishStackSpace"]; +Runtime.setTempRet0 = Module["setTempRet0"]; +Runtime.getTempRet0 = Module["getTempRet0"]; + +// === Auto-generated postamble setup entry stuff === + +Module["asm"] = asm; + +if (memoryInitializer) { + if (typeof Module["locateFile"] === "function") { + memoryInitializer = Module["locateFile"](memoryInitializer); + } else if (Module["memoryInitializerPrefixURL"]) { + memoryInitializer = + Module["memoryInitializerPrefixURL"] + memoryInitializer; + } + if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) { + var data = Module["readBinary"](memoryInitializer); + HEAPU8.set(data, Runtime.GLOBAL_BASE); + } else { + addRunDependency("memory initializer"); + var applyMemoryInitializer = function(data) { + if (data.byteLength) data = new Uint8Array(data); + HEAPU8.set(data, Runtime.GLOBAL_BASE); + // Delete the typed array that contains the large blob of the memory initializer request response so that + // we won't keep unnecessary memory lying around. However, keep the XHR object itself alive so that e.g. + // its .status field can still be accessed later. + if (Module["memoryInitializerRequest"]) + delete Module["memoryInitializerRequest"].response; + removeRunDependency("memory initializer"); + }; + function doBrowserLoad() { + Module[ + "readAsync" + ](memoryInitializer, applyMemoryInitializer, function() { + throw "could not load memory initializer " + memoryInitializer; + }); + } + if (Module["memoryInitializerRequest"]) { + // a network request has already been created, just use that + function useRequest() { + var request = Module["memoryInitializerRequest"]; + if (request.status !== 200 && request.status !== 0) { + // If you see this warning, the issue may be that you are using locateFile or memoryInitializerPrefixURL, and defining them in JS. That + // means that the HTML file doesn't know about them, and when it tries to create the mem init request early, does it to the wrong place. + // Look in your browser's devtools network console to see what's going on. + console.warn( + "a problem seems to have happened with Module.memoryInitializerRequest, status: " + + request.status + + ", retrying " + + memoryInitializer + ); + doBrowserLoad(); + return; + } + applyMemoryInitializer(request.response); + } + if (Module["memoryInitializerRequest"].response) { + setTimeout(useRequest, 0); // it's already here; but, apply it asynchronously + } else { + Module["memoryInitializerRequest"].addEventListener("load", useRequest); // wait for it + } + } else { + // fetch it from the network ourselves + doBrowserLoad(); + } + } +} + +/** + * @constructor + * @extends {Error} + */ +function ExitStatus(status) { + this.name = "ExitStatus"; + this.message = "Program terminated with exit(" + status + ")"; + this.status = status; +} +ExitStatus.prototype = new Error(); +ExitStatus.prototype.constructor = ExitStatus; + +var initialStackTop; +var preloadStartTime = null; +var calledMain = false; + +dependenciesFulfilled = function runCaller() { + // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false) + if (!Module["calledRun"]) run(); + if (!Module["calledRun"]) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled +}; + +Module["callMain"] = Module.callMain = function callMain(args) { + args = args || []; + + ensureInitRuntime(); + + var argc = args.length + 1; + function pad() { + for (var i = 0; i < 4 - 1; i++) { + argv.push(0); + } + } + var argv = [ + allocate(intArrayFromString(Module["thisProgram"]), "i8", ALLOC_NORMAL) + ]; + pad(); + for (var i = 0; i < argc - 1; i = i + 1) { + argv.push(allocate(intArrayFromString(args[i]), "i8", ALLOC_NORMAL)); + pad(); + } + argv.push(0); + argv = allocate(argv, "i32", ALLOC_NORMAL); + + try { + var ret = Module["_main"](argc, argv, 0); + + // if we're not running an evented main loop, it's time to exit + exit(ret, /* implicit = */ true); + } catch (e) { + if (e instanceof ExitStatus) { + // exit() throws this once it's done to make sure execution + // has been stopped completely + return; + } else if (e == "SimulateInfiniteLoop") { + // running an evented main loop, don't immediately exit + Module["noExitRuntime"] = true; + return; + } else { + var toLog = e; + if (e && typeof e === "object" && e.stack) { + toLog = [e, e.stack]; + } + Module.printErr("exception thrown: " + toLog); + Module["quit"](1, e); + } + } finally { + calledMain = true; + } +}; + +/** @type {function(Array=)} */ +function run(args) { + args = args || Module["arguments"]; + + if (preloadStartTime === null) preloadStartTime = Date.now(); + + if (runDependencies > 0) { + return; + } + + preRun(); + + if (runDependencies > 0) return; // a preRun added a dependency, run will be called later + if (Module["calledRun"]) return; // run may have just been called through dependencies being fulfilled just in this very frame + + function doRun() { + if (Module["calledRun"]) return; // run may have just been called while the async setStatus time below was happening + Module["calledRun"] = true; + + if (ABORT) return; + + ensureInitRuntime(); + + preMain(); + + if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); + + if (Module["_main"] && shouldRunNow) Module["callMain"](args); + + postRun(); + } + + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(function() { + setTimeout(function() { + Module["setStatus"](""); + }, 1); + doRun(); + }, 1); + } else { + doRun(); + } +} +Module["run"] = Module.run = run; + +function exit(status, implicit) { + if (implicit && Module["noExitRuntime"]) { + return; + } + + if (Module["noExitRuntime"]) { + } else { + ABORT = true; + EXITSTATUS = status; + STACKTOP = initialStackTop; + + exitRuntime(); + + if (Module["onExit"]) Module["onExit"](status); + } + + if (ENVIRONMENT_IS_NODE) { + process["exit"](status); + } + Module["quit"](status, new ExitStatus(status)); +} +Module["exit"] = Module.exit = exit; + +var abortDecorators = []; + +function abort(what) { + if (Module["onAbort"]) { + Module["onAbort"](what); + } + + if (what !== undefined) { + Module.print(what); + Module.printErr(what); + what = JSON.stringify(what); + } else { + what = ""; + } + + ABORT = true; + EXITSTATUS = 1; + + var extra = + "\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information."; + + var output = "abort(" + what + ") at " + stackTrace() + extra; + if (abortDecorators) { + abortDecorators.forEach(function(decorator) { + output = decorator(output, what); + }); + } + throw output; +} +Module["abort"] = Module.abort = abort; + +// {{PRE_RUN_ADDITIONS}} + +if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") + Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()(); + } +} + +// shouldRunNow refers to calling main(), not run(). +var shouldRunNow = true; +if (Module["noInitialRun"]) { + shouldRunNow = false; +} + +run(); + +// {{POST_RUN_ADDITIONS}} + +// {{MODULE_ADDITIONS}} diff --git a/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.wasm b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.wasm new file mode 100644 index 000000000000..f42d3a4ff505 Binary files /dev/null and b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.wasm differ diff --git a/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.wasm.map b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.wasm.map new file mode 100644 index 000000000000..704f0214d121 --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/average.wasm.map @@ -0,0 +1 @@ +{"version":3,"sources":["average.c"],"names":[],"mappings":"u7BAWA,iBAEA,MADA,wBADA,eAEA,cAKA,aACA"} \ No newline at end of file diff --git a/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/utils.js b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/utils.js new file mode 100644 index 000000000000..906ae0216537 --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/examples/wasm-sourcemaps/utils.js @@ -0,0 +1,75 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +// Simple wasm parser to replace "sourceMappingURL" section. + +function updateSourceMappingURLSection(buffer, sourceMapUrl) { + function readVarUint8(buf, pos) { + let b = buf[pos++]; + let shift = 0; + let result = 0; + while (b & 0x80) { + result |= (b & 0x7f) << shift; + shift += 7; + b = buf[pos++]; + } + return { + value: result | (b << shift), + pos + }; + } + function readWasmString(buf, pos) { + const { pos: next, value: len } = readVarUint8(buf, pos); + const result = String.fromCharCode.apply( + null, + buf.subarray(next, next + len) + ); + return { value: result, pos: next + len }; + } + function toVarUint(n) { + const buf = []; + while (n > 127) { + buf.push((n & 0x7f) | 0x80); + n >>>= 7; + } + buf.push(n); + return buf; + } + function toWasmString(s) { + const buf = toVarUint(s.length); + for (let i = 0; i < s.length; i++) { + buf.push(s.charCodeAt(i)); + } + return buf; + } + + // Appending/replacing sourceMappingURL section based on + // https://github.com/WebAssembly/design/pull/1051 + const mappingSectionBody = toWasmString("sourceMappingURL").concat( + toWasmString(sourceMapUrl) + ); + const mappingSection = toVarUint(0).concat( + toVarUint(mappingSectionBody.length), + mappingSectionBody + ); + const data = new Uint8Array(buffer); + let start = data.length, + end = data.length; + for (let i = 8; i < data.length; ) { + const { pos: next, value: id } = readVarUint8(data, i); + const { pos: next2, value: size } = readVarUint8(data, next); + if (id == 0 && readWasmString(data, next2).value === "sourceMappingURL") { + start = i; + end = next2 + size; + break; + } + i = next2 + size; + } + const result = new Uint8Array( + start + (data.length - end) + mappingSection.length + ); + result.set(data.subarray(0, start)); + result.set(new Uint8Array(mappingSection), start); + result.set(data.subarray(end), start + mappingSection.length); + return result.buffer; +} diff --git a/devtools/client/framework/test/test_browser_toolbox_debugger.js b/devtools/client/framework/test/test_browser_toolbox_debugger.js index 8f1d8309b345..083d9ed7e957 100644 --- a/devtools/client/framework/test/test_browser_toolbox_debugger.js +++ b/devtools/client/framework/test/test_browser_toolbox_debugger.js @@ -20,7 +20,7 @@ Task.spawn(function* () { info("Loaded, selecting the test script to debug"); // First expand the domain let domain = [...document.querySelectorAll(".tree-node")].find(node => { - return node.textContent == "mozilla.org"; + return node.textContent.trim() == "mozilla.org"; }); let arrow = domain.querySelector(".arrow"); arrow.click(); diff --git a/devtools/client/locales/en-US/debugger.properties b/devtools/client/locales/en-US/debugger.properties index 75277f462e6d..19247cd2ced3 100644 --- a/devtools/client/locales/en-US/debugger.properties +++ b/devtools/client/locales/en-US/debugger.properties @@ -21,17 +21,17 @@ copySource.accesskey=y # LOCALIZATION NOTE (copySourceUrl): This is the text that appears in the # context menu to copy the source URL of file open. -copySourceUrl=Copy Source URL +copySourceUrl=Copy source url copySourceUrl.accesskey=u # LOCALIZATION NOTE (copyFunction): This is the text that appears in the # context menu to copy the function the user selected -copyFunction.label=Copy Function +copyFunction.label=Copy function copyFunction.accesskey=F # LOCALIZATION NOTE (copyStackTrace): This is the text that appears in the # context menu to copy the stack trace methods, file names and row number. -copyStackTrace=Copy Stack Trace +copyStackTrace=Copy stack trace copyStackTrace.accesskey=c # LOCALIZATION NOTE (expandPanes): This is the tooltip for the button @@ -52,15 +52,15 @@ resumeButtonTooltip=Resume %S # LOCALIZATION NOTE (stepOverTooltip): The label that is displayed on the # button that steps over a function call. -stepOverTooltip=Step Over %S +stepOverTooltip=Step over %S # LOCALIZATION NOTE (stepInTooltip): The label that is displayed on the # button that steps into a function call. -stepInTooltip=Step In %S +stepInTooltip=Step in %S # LOCALIZATION NOTE (stepOutTooltip): The label that is displayed on the # button that steps out of a function call. -stepOutTooltip=Step Out %S +stepOutTooltip=Step out %S # LOCALIZATION NOTE (workersHeader): The text to display in the events # header. @@ -76,11 +76,11 @@ noSourcesText=This page has no sources. # LOCALIZATION NOTE (noEventListenersText): The text to display in the events tab # when there are no events. -noEventListenersText=No event listeners to display +noEventListenersText=No event listeners to display. # LOCALIZATION NOTE (eventListenersHeader): The text to display in the events # header. -eventListenersHeader=Event Listeners +eventListenersHeader=Event listeners # LOCALIZATION NOTE (noStackFramesText): The text to display in the call stack tab # when there are no stack frames. @@ -152,6 +152,30 @@ projectTextSearch.key=CmdOrCtrl+Shift+F # modal for searching functions in a file. functionSearch.key=CmdOrCtrl+Shift+O +# LOCALIZATION NOTE (toggleBreakpoint.key): A key shortcut to toggle +# breakpoints. +toggleBreakpoint.key=CmdOrCtrl+B + +# LOCALIZATION NOTE (toggleCondPanel.key): A key shortcut to toggle +# the conditional breakpoint panel. +toggleCondPanel.key=CmdOrCtrl+Shift+B + +# LOCALIZATION NOTE (stepOut.key): A key shortcut to +# step out. +stepOut.key=Shift+F11 + +# LOCALIZATION NOTE (shortcuts.header.editor): Sections header in +# the shortcuts modal for keyboard shortcuts related to editing. +shortcuts.header.editor=Editor + +# LOCALIZATION NOTE (shortcuts.header.stepping): Sections header in +# the shortcuts modal for keyboard shortcuts related to stepping. +shortcuts.header.stepping=Stepping + +# LOCALIZATION NOTE (shortcuts.header.search): Sections header in +# the shortcuts modal for keyboard shortcuts related to search. +shortcuts.header.search=Search + # LOCALIZATION NOTE (projectTextSearch.placeholder): A placeholder shown # when searching across all of the files in a project. projectTextSearch.placeholder=Find in files… @@ -227,6 +251,30 @@ searchPanelVariable=Filter variables (%S) # LOCALIZATION NOTE (breakpointMenuItem): The text for all the elements that # are displayed in the breakpoints menu item popup. breakpointMenuItem.setConditional=Configure conditional breakpoint +breakpointMenuItem.enableSelf2.label=Enable +breakpointMenuItem.enableSelf2.accesskey=E +breakpointMenuItem.disableSelf2.label=Disable +breakpointMenuItem.disableSelf2.accesskey=D +breakpointMenuItem.deleteSelf2.label=Remove +breakpointMenuItem.deleteSelf2.accesskey=R +breakpointMenuItem.enableOthers2.label=Enable others +breakpointMenuItem.enableOthers2.accesskey=o +breakpointMenuItem.disableOthers2.label=Disable others +breakpointMenuItem.disableOthers2.accesskey=s +breakpointMenuItem.deleteOthers2.label=Remove others +breakpointMenuItem.deleteOthers2.accesskey=h +breakpointMenuItem.enableAll2.label=Enable all +breakpointMenuItem.enableAll2.accesskey=b +breakpointMenuItem.disableAll2.label=Disable all +breakpointMenuItem.disableAll2.accesskey=k +breakpointMenuItem.deleteAll2.label=Remove all +breakpointMenuItem.deleteAll2.accesskey=a +breakpointMenuItem.removeCondition2.label=Remove condition +breakpointMenuItem.removeCondition2.accesskey=c +breakpointMenuItem.addCondition2.label=Add condition +breakpointMenuItem.addCondition2.accesskey=A +breakpointMenuItem.editCondition2.label=Edit condition +breakpointMenuItem.editCondition2.accesskey=n breakpointMenuItem.enableSelf=Enable breakpoint breakpointMenuItem.enableSelf.accesskey=E breakpointMenuItem.disableSelf=Disable breakpoint @@ -255,34 +303,34 @@ breakpoints.header=Breakpoints # LOCALIZATION NOTE (breakpoints.none): The text that appears when there are # no breakpoints present -breakpoints.none=No Breakpoints +breakpoints.none=No breakpoints # LOCALIZATION NOTE (breakpoints.enable): The text that may appear as a tooltip # when hovering over the 'disable breakpoints' switch button in right sidebar -breakpoints.enable=Enable Breakpoints +breakpoints.enable=Enable breakpoints # LOCALIZATION NOTE (breakpoints.disable): The text that may appear as a tooltip # when hovering over the 'disable breakpoints' switch button in right sidebar -breakpoints.disable=Disable Breakpoints +breakpoints.disable=Disable breakpoints # LOCALIZATION NOTE (breakpoints.removeBreakpointTooltip): The tooltip that is displayed # for remove breakpoint button in right sidebar -breakpoints.removeBreakpointTooltip=Remove Breakpoint +breakpoints.removeBreakpointTooltip=Remove breakpoint # LOCALIZATION NOTE (callStack.header): Call Stack right sidebar pane header. -callStack.header=Call Stack +callStack.header=Call stack # LOCALIZATION NOTE (callStack.notPaused): Call Stack right sidebar pane # message when not paused. -callStack.notPaused=Not Paused +callStack.notPaused=Not paused # LOCALIZATION NOTE (callStack.collapse): Call Stack right sidebar pane # message to hide some of the frames that are shown. -callStack.collapse=Collapse Rows +callStack.collapse=Collapse rows # LOCALIZATION NOTE (callStack.expand): Call Stack right sidebar pane # message to show more of the frames. -callStack.expand=Expand Rows +callStack.expand=Expand rows # LOCALIZATION NOTE (editor.searchResults): Editor Search bar message # for the summarizing the selected search result. e.g. 5 of 10 results. @@ -293,15 +341,15 @@ editor.singleResult=1 result # LOCALIZATION NOTE (editor.noResults): Editor Search bar message # for when no results found. -editor.noResults=no results +editor.noResults=No results # LOCALIZATION NOTE (editor.searchResults.nextResult): Editor Search bar # tooltip for traversing to the Next Result -editor.searchResults.nextResult=Next Result +editor.searchResults.nextResult=Next result # LOCALIZATION NOTE (editor.searchResults.prevResult): Editor Search bar # tooltip for traversing to the Previous Result -editor.searchResults.prevResult=Previous Result +editor.searchResults.prevResult=Previous result # LOCALIZATION NOTE (editor.searchTypeToggleTitle): Search bar title for # toggling search type buttons(function search, variable search) @@ -309,32 +357,32 @@ editor.searchTypeToggleTitle=Search for: # LOCALIZATION NOTE (editor.continueToHere.label): Editor gutter context # menu item for jumping to a new paused location -editor.continueToHere.label=Continue To Here +editor.continueToHere.label=Continue to here editor.continueToHere.accesskey=H # LOCALIZATION NOTE (editor.addBreakpoint): Editor gutter context menu item # for adding a breakpoint on a line. -editor.addBreakpoint=Add Breakpoint +editor.addBreakpoint=Add breakpoint # LOCALIZATION NOTE (editor.disableBreakpoint): Editor gutter context menu item # for disabling a breakpoint on a line. -editor.disableBreakpoint=Disable Breakpoint +editor.disableBreakpoint=Disable breakpoint # LOCALIZATION NOTE (editor.enableBreakpoint): Editor gutter context menu item # for enabling a breakpoint on a line. -editor.enableBreakpoint=Enable Breakpoint +editor.enableBreakpoint=Enable breakpoint # LOCALIZATION NOTE (editor.removeBreakpoint): Editor gutter context menu item # for removing a breakpoint on a line. -editor.removeBreakpoint=Remove Breakpoint +editor.removeBreakpoint=Remove breakpoint # LOCALIZATION NOTE (editor.editBreakpoint): Editor gutter context menu item # for setting a breakpoint condition on a line. -editor.editBreakpoint=Edit Breakpoint +editor.editBreakpoint=Edit breakpoint # LOCALIZATION NOTE (editor.addConditionalBreakpoint): Editor gutter context # menu item for adding a breakpoint condition on a line. -editor.addConditionalBreakpoint=Add Conditional Breakpoint +editor.addConditionalBreakpoint=Add conditional breakpoint # LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Placeholder text for # input element inside ConditionalPanel component @@ -346,80 +394,80 @@ editor.conditionalPanel.close=Cancel edit breakpoint and close # LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item # for navigating to a source mapped location -editor.jumpToMappedLocation1=Jump to %S Location +editor.jumpToMappedLocation1=Jump to %S location # LOCALIZATION NOTE (framework.disableGrouping): This is the text that appears in the # context menu to disable framework grouping. -framework.disableGrouping=Disable Framework Grouping +framework.disableGrouping=Disable framework grouping framework.disableGrouping.accesskey=u # LOCALIZATION NOTE (framework.enableGrouping): This is the text that appears in the # context menu to enable framework grouping. -framework.enableGrouping=Enable Framework Grouping +framework.enableGrouping=Enable framework grouping framework.enableGrouping.accesskey=u # LOCALIZATION NOTE (generated): Source Map term for a server source location generated=Generated # LOCALIZATION NOTE (original): Source Map term for a debugger UI source location -original=Original +original=original # LOCALIZATION NOTE (expressions.placeholder): Placeholder text for expression # input element -expressions.placeholder=Add Watch Expression +expressions.placeholder=Add watch expression # LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item # for closing the selected tab below the mouse. -sourceTabs.closeTab=Close Tab +sourceTabs.closeTab=Close tab sourceTabs.closeTab.accesskey=c # LOCALIZATION NOTE (sourceTabs.closeOtherTabs): Editor source tab context menu item # for closing the other tabs. -sourceTabs.closeOtherTabs=Close Other Tabs +sourceTabs.closeOtherTabs=Close other tabs sourceTabs.closeOtherTabs.accesskey=o # LOCALIZATION NOTE (sourceTabs.closeTabsToEnd): Editor source tab context menu item # for closing the tabs to the end (the right for LTR languages) of the selected tab. -sourceTabs.closeTabsToEnd=Close Tabs to the Right +sourceTabs.closeTabsToEnd=Close tabs to the right sourceTabs.closeTabsToEnd.accesskey=e # LOCALIZATION NOTE (sourceTabs.closeAllTabs): Editor source tab context menu item # for closing all tabs. -sourceTabs.closeAllTabs=Close All Tabs +sourceTabs.closeAllTabs=Close all tabs sourceTabs.closeAllTabs.accesskey=a # LOCALIZATION NOTE (sourceTabs.revealInTree): Editor source tab context menu item # for revealing source in tree. -sourceTabs.revealInTree=Reveal in Tree +sourceTabs.revealInTree=Reveal in tree sourceTabs.revealInTree.accesskey=r # LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item # for copying a link address. -sourceTabs.copyLink=Copy Link Address +sourceTabs.copyLink=Copy link address sourceTabs.copyLink.accesskey=l # LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item # for pretty printing the source. -sourceTabs.prettyPrint=Pretty Print Source +sourceTabs.prettyPrint=Pretty print source sourceTabs.prettyPrint.accesskey=p # LOCALIZATION NOTE (sourceFooter.blackbox): Tooltip text associated # with the blackbox button -sourceFooter.blackbox=Blackbox Source +sourceFooter.blackbox=Blackbox source sourceFooter.blackbox.accesskey=B # LOCALIZATION NOTE (sourceFooter.unblackbox): Tooltip text associated # with the blackbox button -sourceFooter.unblackbox=Unblackbox Source +sourceFooter.unblackbox=Unblackbox source sourceFooter.unblackbox.accesskey=b # LOCALIZATION NOTE (sourceFooter.blackboxed): Text associated # with a blackboxed source -sourceFooter.blackboxed=Blackboxed Source +sourceFooter.blackboxed=Blackboxed source # LOCALIZATION NOTE (sourceFooter.codeCoverage): Text associated # with a code coverage button -sourceFooter.codeCoverage=Code Coverage +sourceFooter.codeCoverage=Code coverage # LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed # for close tab button in source tabs. @@ -434,11 +482,11 @@ scopes.header=Scopes # LOCALIZATION NOTE (scopes.notAvailable): Scopes right sidebar pane message # for when the debugger is paused, but there isn't pause data. -scopes.notAvailable=Scopes Unavailable +scopes.notAvailable=Scopes unavailable # LOCALIZATION NOTE (scopes.notPaused): Scopes right sidebar pane message # for when the debugger is not paused. -scopes.notPaused=Not Paused +scopes.notPaused=Not paused # LOCALIZATION NOTE (scopes.block): Refers to a block of code in # the scopes pane when the debugger is paused. @@ -460,7 +508,7 @@ sources.search=%S to search # LOCALIZATION NOTE (watchExpressions.header): Watch Expressions right sidebar # pane header. -watchExpressions.header=Watch Expressions +watchExpressions.header=Watch expressions # LOCALIZATION NOTE (watchExpressions.refreshButton): Watch Expressions header # button for refreshing the expressions. @@ -507,7 +555,7 @@ loadingText=Loading\u2026 # LOCALIZATION NOTE (errorLoadingText2): The text that is displayed in the debugger # viewer when there is an error loading a file -errorLoadingText2=Error loading this URL: %S +errorLoadingText2=Error loading this url: %S # LOCALIZATION NOTE (addWatchExpressionText): The text that is displayed in the # watch expressions list to add a new item. @@ -639,7 +687,7 @@ variablesViewOptimizedOut=(optimized away) variablesViewUninitialized=(uninitialized) variablesViewMissingArgs=(unavailable) -anonymousSourcesLabel=Anonymous Sources +anonymousSourcesLabel=Anonymous sources experimental=This is an experimental feature @@ -698,3 +746,47 @@ whyPaused.other=Debugger paused # LOCALIZATION NOTE (ctrl): The text that is used for documenting # keyboard shortcuts that use the control key ctrl=Ctrl + +# LOCALIZATION NOTE (anonymous): The text that is displayed when the +# display name is null. +anonymous=(anonymous) + +# LOCALIZATION NOTE (shortcuts.toggleBreakpoint): text describing +# keyboard shortcut action for toggling breakpoint +shortcuts.toggleBreakpoint=Toggle Breakpoint + +# LOCALIZATION NOTE (shortcuts.toggleCondPanel): text describing +# keyboard shortcut action for toggling conditional panel keyboard +shortcuts.toggleCondPanel=Toggle Conditional Panel + +# LOCALIZATION NOTE (shortcuts.pauseOrResume): text describing +# keyboard shortcut action for pause of resume +shortcuts.pauseOrResume=Pause/Resume + +# LOCALIZATION NOTE (shortcuts.stepOver): text describing +# keyboard shortcut action for stepping over +shortcuts.stepOver=Step Over + +# LOCALIZATION NOTE (shortcuts.stepIn): text describing +# keyboard shortcut action for stepping in +shortcuts.stepIn=Step In + +# LOCALIZATION NOTE (shortcuts.stepOut): text describing +# keyboard shortcut action for stepping out +shortcuts.stepOut=Step Out + +# LOCALIZATION NOTE (shortcuts.fileSearch): text describing +# keyboard shortcut action for source file search +shortcuts.fileSearch=Source File Search + +# LOCALIZATION NOTE (shortcuts.searchAgain): text describing +# keyboard shortcut action for searching again +shortcuts.searchAgain=Search Again + +# LOCALIZATION NOTE (shortcuts.projectSearch): text describing +# keyboard shortcut action for full project search +shortcuts.projectSearch=Full Project Search + +# LOCALIZATION NOTE (shortcuts.functionSearch): text describing +# keyboard shortcut action for function search +shortcuts.functionSearch=Function Search diff --git a/devtools/client/preferences/debugger.js b/devtools/client/preferences/debugger.js index ae859446337b..1cfe2dacad7b 100644 --- a/devtools/client/preferences/debugger.js +++ b/devtools/client/preferences/debugger.js @@ -12,6 +12,9 @@ pref("devtools.debugger.remote-timeout", 20000); pref("devtools.debugger.pause-on-exceptions", false); pref("devtools.debugger.ignore-caught-exceptions", false); pref("devtools.debugger.source-maps-enabled", true); +// Temporarily leave this in place, even though it is unused, so the +// options pane doesn't break. +// https://bugzilla.mozilla.org/show_bug.cgi?id=1371849 pref("devtools.debugger.client-source-maps-enabled", true); pref("devtools.debugger.pretty-print-enabled", true); pref("devtools.debugger.auto-pretty-print", false); @@ -39,5 +42,5 @@ pref("devtools.debugger.file-search-case-sensitive", false); pref("devtools.debugger.file-search-whole-word", false); pref("devtools.debugger.file-search-regex-match", false); pref("devtools.debugger.features.async-stepping", true); -pref("devtools.debugger.project-text-search-enabled", true); +pref("devtools.debugger.features.project-text-search", true); pref("devtools.debugger.features.wasm", true); diff --git a/dom/base/TimeoutManager.cpp b/dom/base/TimeoutManager.cpp index 4bb253ed6c82..af3c06d8dee0 100644 --- a/dom/base/TimeoutManager.cpp +++ b/dom/base/TimeoutManager.cpp @@ -1235,7 +1235,6 @@ TimeoutManager::BudgetThrottlingEnabled(bool aIsBackground) const { // A window can be throttled using budget if // * It isn't active - // * If it isn't using user media // * If it isn't using WebRTC // * If it hasn't got open WebSockets // * If it hasn't got active IndexedDB databases @@ -1257,11 +1256,6 @@ TimeoutManager::BudgetThrottlingEnabled(bool aIsBackground) const return false; } - // Check if we have active GetUserMedia - if (mWindow.AsInner()->HasActiveUserMedia()) { - return false; - } - // Check if we have active PeerConnection if (mWindow.AsInner()->HasActivePeerConnections()) { return false; diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 1d3d8a9c5324..51df015afbec 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -1012,8 +1012,7 @@ nsPIDOMWindow::nsPIDOMWindow(nsPIDOMWindowOuter *aOuterWindow) mLargeAllocStatus(LargeAllocStatus::NONE), mHasTriedToCacheTopInnerWindow(false), mNumOfIndexedDBDatabases(0), - mNumOfOpenWebSockets(0), - mNumOfActiveUserMedia(0) + mNumOfOpenWebSockets(0) { if (aOuterWindow) { mTimeoutManager = @@ -4387,7 +4386,6 @@ nsGlobalWindow::UpdateTopInnerWindow() } mTopInnerWindow->UpdateWebSocketCount(-(int32_t)mNumOfOpenWebSockets); - mTopInnerWindow->UpdateUserMediaCount(-(int32_t)mNumOfActiveUserMedia); } void @@ -4548,32 +4546,6 @@ nsPIDOMWindowInner::HasOpenWebSockets() const (mTopInnerWindow && mTopInnerWindow->mNumOfOpenWebSockets); } -void -nsPIDOMWindowInner::UpdateUserMediaCount(int32_t aDelta) -{ - MOZ_ASSERT(NS_IsMainThread()); - - if (aDelta == 0) { - return; - } - - if (mTopInnerWindow && !IsTopInnerWindow()) { - mTopInnerWindow->UpdateUserMediaCount(aDelta); - } - - MOZ_DIAGNOSTIC_ASSERT( - aDelta > 0 || ((aDelta + mNumOfActiveUserMedia) < mNumOfActiveUserMedia)); - - mNumOfActiveUserMedia += aDelta; -} - -bool -nsPIDOMWindowInner::HasActiveUserMedia() const -{ - return (mTopInnerWindow ? mTopInnerWindow->mNumOfActiveUserMedia - : mNumOfActiveUserMedia) > 0; -} - void nsPIDOMWindowOuter::MaybeActiveMediaComponents() { diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h index 38ba8af78cef..86c6546fba3f 100644 --- a/dom/base/nsPIDOMWindow.h +++ b/dom/base/nsPIDOMWindow.h @@ -751,9 +751,6 @@ protected: // The number of open WebSockets. Inner window only. uint32_t mNumOfOpenWebSockets; - - // The number of active user media. Inner window only. - uint32_t mNumOfActiveUserMedia; }; #define NS_PIDOMWINDOWINNER_IID \ @@ -942,12 +939,6 @@ public: // timeout-throttling. bool HasOpenWebSockets() const; - // Increase/Decrease the number of active user media. - void UpdateUserMediaCount(int32_t aDelta); - - // Return true if there are any currently ongoing user media. - bool HasActiveUserMedia() const; - protected: void CreatePerformanceObjectIfNeeded(); }; diff --git a/dom/console/Console.cpp b/dom/console/Console.cpp index 170e4ee094e0..53dcf56bf67d 100644 --- a/dom/console/Console.cpp +++ b/dom/console/Console.cpp @@ -401,15 +401,18 @@ protected: MOZ_ASSERT(!wp->GetWindow()); - AutoSafeJSContext cx; + AutoJSAPI jsapi; + jsapi.Init(); + + JSContext* cx = jsapi.cx(); JS::Rooted global(cx, mConsole->GetOrCreateSandbox(cx, wp->GetPrincipal())); if (NS_WARN_IF(!global)) { return; } - // The CreateSandbox call returns a proxy to the actual sandbox object. We - // don't need a proxy here. + // The GetOrCreateSandbox call returns a proxy to the actual sandbox object. + // We don't need a proxy here. global = js::UncheckedUnwrap(global); JSAutoCompartment ac(cx, global); diff --git a/dom/file/MutableBlobStorage.cpp b/dom/file/MutableBlobStorage.cpp index 3823b9204b6a..cf986b6913d9 100644 --- a/dom/file/MutableBlobStorage.cpp +++ b/dom/file/MutableBlobStorage.cpp @@ -413,7 +413,7 @@ MutableBlobStorage::~MutableBlobStorage() } } -uint64_t +void MutableBlobStorage::GetBlobWhenReady(nsISupports* aParent, const nsACString& aContentType, MutableBlobStorageCallback* aCallback) @@ -433,7 +433,7 @@ MutableBlobStorage::GetBlobWhenReady(nsISupports* aParent, RefPtr runnable = new BlobCreationDoneRunnable(this, aCallback, nullptr, mErrorResult); EventTarget()->Dispatch(runnable.forget(), NS_DISPATCH_NORMAL); - return 0; + return; } // We want to wait until all the WriteRunnable are completed. The way we do @@ -442,7 +442,7 @@ MutableBlobStorage::GetBlobWhenReady(nsISupports* aParent, RefPtr runnable = new LastRunnable(this, aParent, aContentType, aCallback); DispatchToIOThread(runnable.forget()); - return mDataLen; + return; } // If we are waiting for the temporary file, it's better to wait... @@ -450,7 +450,7 @@ MutableBlobStorage::GetBlobWhenReady(nsISupports* aParent, mPendingParent = aParent; mPendingContentType = aContentType; mPendingCallback = aCallback; - return mDataLen; + return; } RefPtr blobImpl; @@ -472,10 +472,8 @@ MutableBlobStorage::GetBlobWhenReady(nsISupports* aParent, nsresult error = EventTarget()->Dispatch(runnable.forget(), NS_DISPATCH_NORMAL); if (NS_WARN_IF(NS_FAILED(error))) { - return 0; + return; } - - return mDataLen; } nsresult diff --git a/dom/file/MutableBlobStorage.h b/dom/file/MutableBlobStorage.h index 4d038a1c73c7..26ec7893e41b 100644 --- a/dom/file/MutableBlobStorage.h +++ b/dom/file/MutableBlobStorage.h @@ -51,10 +51,9 @@ public: // This method can be called just once. // The callback will be called when the Blob is ready. - // The return value is the total size of the blob, when created. - uint64_t GetBlobWhenReady(nsISupports* aParent, - const nsACString& aContentType, - MutableBlobStorageCallback* aCallback); + void GetBlobWhenReady(nsISupports* aParent, + const nsACString& aContentType, + MutableBlobStorageCallback* aCallback); void TemporaryFileCreated(PRFileDesc* aFD); diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index b6fb8633fc8a..b67ac425154a 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -1684,8 +1684,7 @@ TabChild::RecvRealMouseButtonEvent(const WidgetMouseEvent& aEvent, aInputBlockId); } - nsEventStatus unused; - InputAPZContext context(aGuid, aInputBlockId, unused); + InputAPZContext context(aGuid, aInputBlockId, nsEventStatus_eIgnore); if (pendingLayerization) { context.SetPendingLayerization(); } diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 672ac285cdc0..de95a3f54eeb 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -2933,11 +2933,6 @@ MediaManager::AddWindowID(uint64_t aWindowId, return; } - auto* window = nsGlobalWindow::GetInnerWindowWithId(aWindowId); - if (window) { - window->AsInner()->UpdateUserMediaCount(1); - } - GetActiveWindows()->Put(aWindowId, aListener); } @@ -2953,8 +2948,6 @@ MediaManager::RemoveWindowID(uint64_t aWindowId) return; } - window->AsInner()->UpdateUserMediaCount(-1); - nsPIDOMWindowOuter* outer = window->AsInner()->GetOuterWindow(); if (!outer) { LOG(("No outer window for inner %" PRIu64, aWindowId)); diff --git a/dom/media/MediaRecorder.cpp b/dom/media/MediaRecorder.cpp index a0647c93f278..b4142b702da7 100644 --- a/dom/media/MediaRecorder.cpp +++ b/dom/media/MediaRecorder.cpp @@ -158,11 +158,11 @@ NS_IMPL_RELEASE_INHERITED(MediaRecorder, DOMEventTargetHelper) /** * Session is an object to represent a single recording event. * In original design, all recording context is stored in MediaRecorder, which causes - * a problem if someone calls MediaRecoder::Stop and MedaiRecorder::Start quickly. + * a problem if someone calls MediaRecorder::Stop and MediaRecorder::Start quickly. * To prevent blocking main thread, media encoding is executed in a second thread, * named as Read Thread. For the same reason, we do not wait Read Thread shutdown in - * MediaRecorder::Stop. If someone call MediaRecoder::Start before Read Thread shutdown, - * the same recording context in MediaRecoder might be access by two Reading Threads, + * MediaRecorder::Stop. If someone call MediaRecorder::Start before Read Thread shutdown, + * the same recording context in MediaRecorder might be access by two Reading Threads, * which cause a problem. * In the new design, we put recording context into Session object, including Read * Thread. Each Session has its own recording context and Read Thread, problem is been @@ -1045,7 +1045,7 @@ private: } private: - // Hold reference to MediaRecoder that ensure MediaRecorder is alive + // Hold reference to MediaRecorder that ensure MediaRecorder is alive // if there is an active session. Access ONLY on main thread. RefPtr mRecorder; diff --git a/dom/media/webaudio/AudioContext.cpp b/dom/media/webaudio/AudioContext.cpp index 9cad53ad8e32..37fb4c473ca2 100644 --- a/dom/media/webaudio/AudioContext.cpp +++ b/dom/media/webaudio/AudioContext.cpp @@ -562,7 +562,7 @@ AudioContext::DecodeAudioData(const ArrayBuffer& aBuffer, successCallback = &aSuccessCallback.Value(); } UniquePtr job( - new WebAudioDecodeJob(contentType, this, + new WebAudioDecodeJob(this, promise, successCallback, failureCallback)); AsyncDecodeWebAudio(contentType.get(), data, length, *job); // Transfer the ownership to mDecodeJobs diff --git a/dom/media/webaudio/MediaBufferDecoder.cpp b/dom/media/webaudio/MediaBufferDecoder.cpp index 371015032e24..c842003b4825 100644 --- a/dom/media/webaudio/MediaBufferDecoder.cpp +++ b/dom/media/webaudio/MediaBufferDecoder.cpp @@ -514,13 +514,11 @@ AsyncDecodeWebAudio(const char* aContentType, uint8_t* aBuffer, } } -WebAudioDecodeJob::WebAudioDecodeJob(const nsACString& aContentType, - AudioContext* aContext, +WebAudioDecodeJob::WebAudioDecodeJob(AudioContext* aContext, Promise* aPromise, DecodeSuccessCallback* aSuccessCallback, DecodeErrorCallback* aFailureCallback) - : mContentType(aContentType) - , mContext(aContext) + : mContext(aContext) , mPromise(aPromise) , mSuccessCallback(aSuccessCallback) , mFailureCallback(aFailureCallback) @@ -609,7 +607,6 @@ size_t WebAudioDecodeJob::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const { size_t amount = 0; - amount += mContentType.SizeOfExcludingThisIfUnshared(aMallocSizeOf); if (mSuccessCallback) { amount += mSuccessCallback->SizeOfIncludingThis(aMallocSizeOf); } diff --git a/dom/media/webaudio/MediaBufferDecoder.h b/dom/media/webaudio/MediaBufferDecoder.h index fc9bc80b33df..52e370681361 100644 --- a/dom/media/webaudio/MediaBufferDecoder.h +++ b/dom/media/webaudio/MediaBufferDecoder.h @@ -31,8 +31,7 @@ struct WebAudioDecodeJob final { // You may omit both the success and failure callback, or you must pass both. // The callbacks are only necessary for asynchronous operation. - WebAudioDecodeJob(const nsACString& aContentType, - dom::AudioContext* aContext, + WebAudioDecodeJob(dom::AudioContext* aContext, dom::Promise* aPromise, dom::DecodeSuccessCallback* aSuccessCallback = nullptr, dom::DecodeErrorCallback* aFailureCallback = nullptr); @@ -57,7 +56,6 @@ struct WebAudioDecodeJob final size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; AudioChunk mBuffer; - nsCString mContentType; RefPtr mContext; RefPtr mPromise; RefPtr mSuccessCallback; diff --git a/dom/push/test/xpcshell/xpcshell.ini b/dom/push/test/xpcshell/xpcshell.ini index 82abbca2f92d..64513535767b 100644 --- a/dom/push/test/xpcshell/xpcshell.ini +++ b/dom/push/test/xpcshell/xpcshell.ini @@ -47,6 +47,7 @@ run-sequentially = This will delete all existing push subscriptions. [test_unregister_not_found.js] [test_unregister_success.js] [test_updateRecordNoEncryptionKeys_ws.js] +skip-if = os == "linux" # Bug 1265233 [test_reconnect_retry.js] [test_retry_ws.js] [test_service_parent.js] diff --git a/dom/workers/ServiceWorkerClients.cpp b/dom/workers/ServiceWorkerClients.cpp index 049b14def81f..82785055fd65 100644 --- a/dom/workers/ServiceWorkerClients.cpp +++ b/dom/workers/ServiceWorkerClients.cpp @@ -8,6 +8,7 @@ #include "mozilla/dom/Promise.h" #include "mozilla/dom/PromiseWorkerProxy.h" +#include "mozilla/JSObjectHolder.h" #include "ServiceWorkerClient.h" #include "ServiceWorkerManager.h" @@ -670,6 +671,9 @@ private: MOZ_DIAGNOSTIC_ASSERT(aWindow); WorkerPrivate* workerPrivate = mPromiseProxy->GetWorkerPrivate(); + nsCOMPtr triggeringPrincipal = workerPrivate->GetPrincipal(); + MOZ_DIAGNOSTIC_ASSERT(triggeringPrincipal); + // [[1. Let url be the result of parsing url with entry settings object's API // base URL.]] nsCOMPtr uri; @@ -694,6 +698,25 @@ private: } if (XRE_IsContentProcess()) { + + // Let's create a sandbox in order to have a valid JSContext and correctly + // propagate the SubjectPrincipal. + AutoJSAPI jsapi; + jsapi.Init(); + + JSContext* cx = jsapi.cx(); + + nsIXPConnect* xpc = nsContentUtils::XPConnect(); + MOZ_ASSERT(xpc, "This should never be null!"); + + JS::Rooted sandbox(cx); + rv = xpc->CreateSandbox(cx, triggeringPrincipal, sandbox.address()); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } + + JSAutoCompartment ac(cx, sandbox); + // ContentProcess nsCOMPtr wwatch = do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv); @@ -754,9 +777,6 @@ private: return NS_ERROR_FAILURE; } - nsCOMPtr triggeringPrincipal = workerPrivate->GetPrincipal(); - MOZ_DIAGNOSTIC_ASSERT(triggeringPrincipal); - nsCOMPtr win; rv = bwin->OpenURI(uri, nullptr, nsIBrowserDOMWindow::OPEN_DEFAULTWINDOW, diff --git a/dom/workers/test/serviceworkers/browser.ini b/dom/workers/test/serviceworkers/browser.ini index e57bd1ebe544..8107150a9727 100644 --- a/dom/workers/test/serviceworkers/browser.ini +++ b/dom/workers/test/serviceworkers/browser.ini @@ -5,10 +5,14 @@ support-files = download/window.html download/worker.js file_multie10s_update.html + file_userContextId_openWindow.js force_refresh_browser_worker.js + empty.html server_multie10s_update.sjs [browser_force_refresh.js] [browser_download.js] [browser_multie10s_update.js] run-if=e10s +[browser_userContextId_openWindow.js] +run-if=e10s diff --git a/dom/workers/test/serviceworkers/browser_userContextId_openWindow.js b/dom/workers/test/serviceworkers/browser_userContextId_openWindow.js new file mode 100644 index 000000000000..842c805b054e --- /dev/null +++ b/dom/workers/test/serviceworkers/browser_userContextId_openWindow.js @@ -0,0 +1,131 @@ +let { classes: Cc, interfaces: Ci, manager: Cm, results: Cr } = Components; + +let swm = Cc["@mozilla.org/serviceworkers/manager;1"]. + getService(Ci.nsIServiceWorkerManager); + +const URI = "https://example.com/browser/dom/workers/test/serviceworkers/empty.html"; +const MOCK_CID = Components.ID("{2a0f83c4-8818-4914-a184-f1172b4eaaa7}"); +const ALERTS_SERVICE_CONTRACT_ID = "@mozilla.org/alerts-service;1"; +const USER_CONTEXT_ID = 3 + +let mockAlertsService = { + showAlert: function(alert, alertListener) { + ok(true, "Showing alert"); + setTimeout(function () { + alertListener.observe(null, "alertshow", alert.cookie); + }, 100); + setTimeout(function () { + alertListener.observe(null, "alertclickcallback", alert.cookie); + }, 100); + }, + + showAlertNotification: function(imageUrl, title, text, textClickable, + cookie, alertListener, name, dir, lang, data) { + this.showAlert(); + }, + + QueryInterface: function(aIID) { + if (aIID.equals(Ci.nsISupports) || aIID.equals(Ci.nsIAlertsService)) { + return this; + } + throw Components.results.NS_ERROR_NO_INTERFACE; + }, + + createInstance: function(aOuter, aIID) { + if (aOuter != null) { + throw Cr.NS_ERROR_NO_AGGREGATION; + } + return this.QueryInterface(aIID); + } +}; + +registerCleanupFunction(() => { + Cm.QueryInterface(Ci.nsIComponentRegistrar). + unregisterFactory(MOCK_CID, mockAlertsService); +}); + +add_task(async function setup() { + // make sure userContext, SW and notifications are enabled. + await SpecialPowers.pushPrefEnv({"set": [ + ["privacy.userContext.enabled", true], + ["dom.serviceWorkers.exemptFromPerDomainMax", true], + ["dom.serviceWorkers.enabled", true], + ["dom.serviceWorkers.testing.enabled", true], + ["dom.webnotifications.workers.enabled", true], + ["dom.webnotifications.serviceworker.enabled", true], + ["notification.prompt.testing", true], + ["dom.disable_open_click_delay", 1000], + ["dom.serviceWorkers.idle_timeout", 299999], + ["dom.serviceWorkers.idle_extended_timeout", 299999], + ["browser.link.open_newwindow", 3], + ]}); +}); + +add_task(async function test() { + Cm.QueryInterface(Ci.nsIComponentRegistrar). + registerFactory(MOCK_CID, "alerts service", ALERTS_SERVICE_CONTRACT_ID, + mockAlertsService); + + // open the tab in the correct userContextId + let tab = BrowserTestUtils.addTab(gBrowser, URI, {userContextId: USER_CONTEXT_ID}); + let browser = gBrowser.getBrowserForTab(tab); + + // select tab and make sure its browser is focused + gBrowser.selectedTab = tab; + tab.ownerGlobal.focus(); + + // wait for tab load + await BrowserTestUtils.browserLoaded(gBrowser.getBrowserForTab(tab)); + + // Waiting for new tab. + let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, null, true); + + // here the test. + let uci = await ContentTask.spawn(browser, URI, uri => { + let uci = content.document.nodePrincipal.userContextId; + + // Registration of the SW + return content.navigator.serviceWorker.register("file_userContextId_openWindow.js") + + // Activation + .then(swr => { + return new content.window.Promise(resolve => { + let worker = swr.installing; + worker.addEventListener('statechange', () => { + if (worker.state === 'activated') { + resolve(swr); + } + }); + }); + }) + + // Ask for an openWindow. + .then(swr => { + swr.showNotification("testPopup"); + return uci; + }); + }); + + is(uci, USER_CONTEXT_ID, "Tab runs with UCI " + USER_CONTEXT_ID); + + let newTab = await newTabPromise; + + is(newTab.getAttribute("usercontextid"), USER_CONTEXT_ID, "New tab has UCI equal " + USER_CONTEXT_ID); + + // wait for SW unregistration + uci = await ContentTask.spawn(browser, null, () => { + let uci = content.document.nodePrincipal.userContextId; + + return content.navigator.serviceWorker.getRegistration(".").then(registration => { + return registration.unregister(); + }) + .then(() => { + return uci; + }); + }); + + is(uci, USER_CONTEXT_ID, "Tab runs with UCI " + USER_CONTEXT_ID); + + await BrowserTestUtils.removeTab(newTab); + await BrowserTestUtils.removeTab(tab); +}); diff --git a/dom/workers/test/serviceworkers/empty.html b/dom/workers/test/serviceworkers/empty.html new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/dom/workers/test/serviceworkers/file_userContextId_openWindow.js b/dom/workers/test/serviceworkers/file_userContextId_openWindow.js new file mode 100644 index 000000000000..2d09d9fb178e --- /dev/null +++ b/dom/workers/test/serviceworkers/file_userContextId_openWindow.js @@ -0,0 +1,3 @@ +onnotificationclick = event => { + clients.openWindow("empty.html"); +} diff --git a/editor/libeditor/EditorBase.cpp b/editor/libeditor/EditorBase.cpp index 0a869f1f472b..e7adec72a02b 100644 --- a/editor/libeditor/EditorBase.cpp +++ b/editor/libeditor/EditorBase.cpp @@ -2430,12 +2430,30 @@ EditorBase::FindBetterInsertionPoint(nsCOMPtr& aNode, // In some other cases, aNode is the anonymous DIV, and offset points to the // terminating mozBR. In that case, we'll adjust aInOutNode and // aInOutOffset to the preceding text node, if any. - if (offset > 0 && node->GetChildAt(offset - 1) && - node->GetChildAt(offset - 1)->IsNodeOfType(nsINode::eTEXT)) { - NS_ENSURE_TRUE_VOID(node->Length() <= INT32_MAX); - aNode = node->GetChildAt(offset - 1); - aOffset = static_cast(aNode->Length()); - return; + if (offset) { + if (offset == static_cast(node->GetChildCount())) { + // If offset points to the last child, use a fast path that avoids calling + // GetChildAt() which may perform a linear search. + nsIContent* child = node->GetLastChild(); + while (child) { + if (child->IsNodeOfType(nsINode::eTEXT)) { + NS_ENSURE_TRUE_VOID(node->Length() <= INT32_MAX); + aNode = child; + aOffset = static_cast(aNode->Length()); + return; + } + child = child->GetPreviousSibling(); + } + } else { + // Fall back to a slow path that uses GetChildAt(). + nsIContent* child = node->GetChildAt(offset - 1); + if (child && child->IsNodeOfType(nsINode::eTEXT)) { + NS_ENSURE_TRUE_VOID(node->Length() <= INT32_MAX); + aNode = child; + aOffset = static_cast(aNode->Length()); + return; + } + } } } diff --git a/editor/libeditor/HTMLEditor.cpp b/editor/libeditor/HTMLEditor.cpp index 0937c7d65ce7..fd71db6e5409 100644 --- a/editor/libeditor/HTMLEditor.cpp +++ b/editor/libeditor/HTMLEditor.cpp @@ -1728,7 +1728,6 @@ HTMLEditor::GetCSSBackgroundColorState(bool* aMixed, // get selection location nsCOMPtr parent = selection->GetRangeAt(0)->GetStartContainer(); - int32_t offset = selection->GetRangeAt(0)->StartOffset(); NS_ENSURE_TRUE(parent, NS_ERROR_NULL_POINTER); // is the selection collapsed? @@ -1739,7 +1738,7 @@ HTMLEditor::GetCSSBackgroundColorState(bool* aMixed, } else { // otherwise we want to look at the first editable node after // {parent,offset} and its ancestors for divs with alignment on them - nodeToExamine = parent->GetChildAt(offset); + nodeToExamine = selection->GetRangeAt(0)->GetChildAtStartOffset(); //GetNextNode(parent, offset, true, address_of(nodeToExamine)); } @@ -2350,16 +2349,15 @@ HTMLEditor::GetSelectedElement(const nsAString& aTagName, NS_ENSURE_STATE(range); nsCOMPtr startContainer = range->GetStartContainer(); - uint32_t startOffset = range->StartOffset(); + nsIContent* startNode = range->GetChildAtStartOffset(); nsCOMPtr endContainer = range->GetEndContainer(); - uint32_t endOffset = range->EndOffset(); + nsIContent* endNode = range->GetChildAtEndOffset(); // Optimization for a single selected element if (startContainer && startContainer == endContainer && - endOffset - startOffset == 1) { - nsCOMPtr selectedNode = - startContainer->GetChildAt(static_cast(startOffset)); + startNode && endNode && startNode->GetNextSibling() == endNode) { + nsCOMPtr selectedNode = startNode; if (selectedNode) { selectedNode->AsDOMNode()->GetNodeName(domTagName); ToLowerCase(domTagName); diff --git a/extensions/universalchardet/src/base/nsCodingStateMachine.h b/extensions/universalchardet/src/base/nsCodingStateMachine.h index e200b5f65846..f8ffd5fe2c8f 100644 --- a/extensions/universalchardet/src/base/nsCodingStateMachine.h +++ b/extensions/universalchardet/src/base/nsCodingStateMachine.h @@ -9,11 +9,12 @@ #include "nsPkgInt.h" -typedef enum { - eStart = 0, - eError = 1, - eItsMe = 2 -} nsSMState; +/* Apart from these 3 generic states, machine states are specific to + * each charset prober. + */ +#define eStart 0 +#define eError 1 +#define eItsMe 2 #define GETCLASS(c) GETFROMPCK(((unsigned char)(c)), mModel->classTable) @@ -33,7 +34,7 @@ typedef struct class nsCodingStateMachine { public: explicit nsCodingStateMachine(const SMModel* sm) : mModel(sm) { mCurrentState = eStart; } - nsSMState NextState(char c){ + uint32_t NextState(char c){ //for each byte we get its class , if it is first byte, we also get byte length uint32_t byteCls = GETCLASS(c); if (mCurrentState == eStart) @@ -43,8 +44,8 @@ public: mCurrentCharLen = mModel->charLenTable[byteCls]; } //from byte's class and stateTable, we get its next state - mCurrentState=(nsSMState)GETFROMPCK(mCurrentState*(mModel->classFactor)+byteCls, - mModel->stateTable); + mCurrentState = GETFROMPCK(mCurrentState * mModel->classFactor + byteCls, + mModel->stateTable); mCurrentBytePos++; return mCurrentState; } @@ -53,7 +54,7 @@ public: const char * GetCodingStateMachine() {return mModel->name;} protected: - nsSMState mCurrentState; + uint32_t mCurrentState; uint32_t mCurrentCharLen; uint32_t mCurrentBytePos; diff --git a/extensions/universalchardet/src/base/nsEUCJPProber.cpp b/extensions/universalchardet/src/base/nsEUCJPProber.cpp index 8ba0ab7f693d..becebf883355 100644 --- a/extensions/universalchardet/src/base/nsEUCJPProber.cpp +++ b/extensions/universalchardet/src/base/nsEUCJPProber.cpp @@ -22,7 +22,7 @@ void nsEUCJPProber::Reset(void) nsProbingState nsEUCJPProber::HandleData(const char* aBuf, uint32_t aLen) { NS_ASSERTION(aLen, "HandleData called with empty buffer"); - nsSMState codingState; + uint32_t codingState; for (uint32_t i = 0; i < aLen; i++) { diff --git a/extensions/universalchardet/src/base/nsEscCharsetProber.cpp b/extensions/universalchardet/src/base/nsEscCharsetProber.cpp index b4fbfeb00b4f..87b1a267f29a 100644 --- a/extensions/universalchardet/src/base/nsEscCharsetProber.cpp +++ b/extensions/universalchardet/src/base/nsEscCharsetProber.cpp @@ -27,7 +27,7 @@ void nsEscCharSetProber::Reset(void) nsProbingState nsEscCharSetProber::HandleData(const char* aBuf, uint32_t aLen) { - nsSMState codingState; + uint32_t codingState; uint32_t i; for ( i = 0; i < aLen && mState == eDetecting; i++) diff --git a/extensions/universalchardet/src/base/nsSJISProber.cpp b/extensions/universalchardet/src/base/nsSJISProber.cpp index d50643994cd0..9e390bba9a5c 100644 --- a/extensions/universalchardet/src/base/nsSJISProber.cpp +++ b/extensions/universalchardet/src/base/nsSJISProber.cpp @@ -22,7 +22,7 @@ void nsSJISProber::Reset(void) nsProbingState nsSJISProber::HandleData(const char* aBuf, uint32_t aLen) { NS_ASSERTION(aLen, "HandleData called with empty buffer"); - nsSMState codingState; + uint32_t codingState; for (uint32_t i = 0; i < aLen; i++) { diff --git a/extensions/universalchardet/src/base/nsUTF8Prober.cpp b/extensions/universalchardet/src/base/nsUTF8Prober.cpp index 01fcedd3d25a..05ad0a023aa3 100644 --- a/extensions/universalchardet/src/base/nsUTF8Prober.cpp +++ b/extensions/universalchardet/src/base/nsUTF8Prober.cpp @@ -14,7 +14,7 @@ void nsUTF8Prober::Reset(void) nsProbingState nsUTF8Prober::HandleData(const char* aBuf, uint32_t aLen) { - nsSMState codingState; + uint32_t codingState; for (uint32_t i = 0; i < aLen; i++) { diff --git a/gfx/layers/apz/test/mochitest/helper_scroll_tables_perspective.html b/gfx/layers/apz/test/mochitest/helper_scroll_tables_perspective.html new file mode 100644 index 000000000000..a7ef42a2b5a7 --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_scroll_tables_perspective.html @@ -0,0 +1,67 @@ + + + + + + + + + +
+
+
+
+
+ A
+ B
+ C
+ D
+ E
+ f
+ g
+ h
+ i
+ j
+
+
+ + diff --git a/gfx/layers/apz/test/mochitest/mochitest.ini b/gfx/layers/apz/test/mochitest/mochitest.ini index 790b4d61b29b..f13ba41104ab 100644 --- a/gfx/layers/apz/test/mochitest/mochitest.ini +++ b/gfx/layers/apz/test/mochitest/mochitest.ini @@ -25,6 +25,7 @@ helper_scroll_inactive_zindex.html helper_scroll_on_position_fixed.html helper_scroll_over_scrollbar.html + helper_scroll_tables_perspective.html helper_scrollto_tap.html helper_subframe_style.css helper_tall.html diff --git a/gfx/layers/apz/test/mochitest/test_group_wheelevents.html b/gfx/layers/apz/test/mochitest/test_group_wheelevents.html index 9cad507eacd6..daec7ee7a154 100644 --- a/gfx/layers/apz/test/mochitest/test_group_wheelevents.html +++ b/gfx/layers/apz/test/mochitest/test_group_wheelevents.html @@ -31,7 +31,8 @@ var subtests = [ {'file': 'helper_bug1271432.html', 'prefs': prefs}, {'file': 'helper_scroll_inactive_perspective.html', 'prefs': prefs}, {'file': 'helper_scroll_inactive_zindex.html', 'prefs': prefs}, - {'file': 'helper_scroll_over_scrollbar.html', 'prefs': scrollbar_prefs} + {'file': 'helper_scroll_over_scrollbar.html', 'prefs': scrollbar_prefs}, + {'file': 'helper_scroll_tables_perspective.html', 'prefs': prefs}, ]; if (isApzEnabled()) { diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build index d85366c6d9f3..2ba915080819 100644 --- a/ipc/chromium/moz.build +++ b/ipc/chromium/moz.build @@ -142,6 +142,13 @@ if os_bsd or os_linux: 'src/base/message_pump_glib.cc', ] +if os_solaris: + SOURCES += [ + 'src/base/atomicops_internals_x86_gcc.cc', + 'src/base/process_util_linux.cc', + 'src/base/time_posix.cc', + ] + ost = CONFIG['OS_TEST'] if '86' not in ost and 'arm' not in ost and 'aarch64' != ost and 'mips' not in ost: SOURCES += [ diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index 13701acfd64a..c56691b3e6e8 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -2431,7 +2431,7 @@ CopyArray(JSContext* cx, HandleArrayObject arr, MutableHandleValue result) if (!nobj) return false; EnsureArrayGroupAnalyzed(cx, nobj); //XXX - CopyBoxedOrUnboxedDenseElements(cx, nobj, arr, 0, 0, length); + nobj->initDenseElements(arr, 0, length); result.setObject(*nobj); return true; diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index ac59a28b6425..5897645909d4 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -8713,11 +8713,10 @@ CodeGenerator::visitFallibleStoreElementV(LFallibleStoreElementV* lir) masm.bind(&isFrozen); } -typedef bool (*SetDenseOrUnboxedArrayElementFn)(JSContext*, HandleObject, int32_t, - HandleValue, bool strict); -static const VMFunction SetDenseOrUnboxedArrayElementInfo = - FunctionInfo(SetDenseOrUnboxedArrayElement, - "SetDenseOrUnboxedArrayElement"); +typedef bool (*SetDenseElementFn)(JSContext*, HandleNativeObject, int32_t, HandleValue, + bool strict); +static const VMFunction SetDenseElementInfo = + FunctionInfo(jit::SetDenseElement, "SetDenseElement"); void CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool) @@ -8826,7 +8825,7 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool) else pushArg(ToRegister(index)); pushArg(object); - callVM(SetDenseOrUnboxedArrayElementInfo, ins); + callVM(SetDenseElementInfo, ins); restoreLive(ins); masm.jump(ool->rejoin()); @@ -9015,7 +9014,7 @@ CodeGenerator::visitArrayPopShiftT(LArrayPopShiftT* lir) emitArrayPopShift(lir, lir->mir(), obj, elements, length, out); } -typedef bool (*ArrayPushDenseFn)(JSContext*, HandleObject, HandleValue, uint32_t*); +typedef bool (*ArrayPushDenseFn)(JSContext*, HandleArrayObject, HandleValue, uint32_t*); static const VMFunction ArrayPushDenseInfo = FunctionInfo(jit::ArrayPushDense, "ArrayPushDense"); diff --git a/js/src/jit/VMFunctions.cpp b/js/src/jit/VMFunctions.cpp index c68284f03035..a6bb2de5f3d4 100644 --- a/js/src/jit/VMFunctions.cpp +++ b/js/src/jit/VMFunctions.cpp @@ -350,21 +350,20 @@ ArrayPopDense(JSContext* cx, HandleObject obj, MutableHandleValue rval) } bool -ArrayPushDense(JSContext* cx, HandleObject obj, HandleValue v, uint32_t* length) +ArrayPushDense(JSContext* cx, HandleArrayObject arr, HandleValue v, uint32_t* length) { - *length = obj->as().length(); - DenseElementResult result = - SetOrExtendBoxedOrUnboxedDenseElements(cx, obj, *length, v.address(), 1, - ShouldUpdateTypes::DontUpdate); + *length = arr->length(); + DenseElementResult result = arr->setOrExtendDenseElements(cx, *length, v.address(), 1, + ShouldUpdateTypes::DontUpdate); if (result != DenseElementResult::Incomplete) { (*length)++; return result == DenseElementResult::Success; } // AutoDetectInvalidation uses GetTopJitJSScript(cx)->ionScript(), but it's - // possible the SetOrExtendAnyBoxedOrUnboxedDenseElements call already - // invalidated the IonScript. JSJitFrameIter::ionScript works when the - // script is invalidated so we use that instead. + // possible the setOrExtendDenseElements call already invalidated the + // IonScript. JSJitFrameIter::ionScript works when the script is invalidated + // so we use that instead. JSJitFrameIter frame(cx); MOZ_ASSERT(frame.type() == JitFrame_Exit); ++frame; @@ -373,7 +372,7 @@ ArrayPushDense(JSContext* cx, HandleObject obj, HandleValue v, uint32_t* length) JS::AutoValueArray<3> argv(cx); AutoDetectInvalidation adi(cx, argv[0], ionScript); argv[0].setUndefined(); - argv[1].setObject(*obj); + argv[1].setObject(*arr); argv[2].set(v); if (!js::array_push(cx, 1, argv.begin())) return false; @@ -1050,8 +1049,7 @@ InitRestParameter(JSContext* cx, uint32_t length, Value* rest, HandleObject temp if (length > 0) { if (!arrRes->ensureElements(cx, length)) return nullptr; - arrRes->setDenseInitializedLength(length); - arrRes->initDenseElements(0, rest, length); + arrRes->initDenseElements(rest, length); arrRes->setLengthInt32(length); } return arrRes; @@ -1297,16 +1295,15 @@ Recompile(JSContext* cx) } bool -SetDenseOrUnboxedArrayElement(JSContext* cx, HandleObject obj, int32_t index, - HandleValue value, bool strict) +SetDenseElement(JSContext* cx, HandleNativeObject obj, int32_t index, HandleValue value, + bool strict) { // This function is called from Ion code for StoreElementHole's OOL path. - // In this case we know the object is native or an unboxed array and that - // no type changes are needed. + // In this case we know the object is native and that no type changes are + // needed. - DenseElementResult result = - SetOrExtendBoxedOrUnboxedDenseElements(cx, obj, index, value.address(), 1, - ShouldUpdateTypes::DontUpdate); + DenseElementResult result = obj->setOrExtendDenseElements(cx, index, value.address(), 1, + ShouldUpdateTypes::DontUpdate); if (result != DenseElementResult::Incomplete) return result == DenseElementResult::Success; diff --git a/js/src/jit/VMFunctions.h b/js/src/jit/VMFunctions.h index d37a58fa3ea0..e79c62f1b8bb 100644 --- a/js/src/jit/VMFunctions.h +++ b/js/src/jit/VMFunctions.h @@ -662,7 +662,8 @@ MOZ_MUST_USE bool StringSplitHelper(JSContext* cx, HandleString str, HandleStrin MutableHandleValue result); MOZ_MUST_USE bool ArrayPopDense(JSContext* cx, HandleObject obj, MutableHandleValue rval); -MOZ_MUST_USE bool ArrayPushDense(JSContext* cx, HandleObject obj, HandleValue v, uint32_t* length); +MOZ_MUST_USE bool ArrayPushDense(JSContext* cx, HandleArrayObject arr, HandleValue v, + uint32_t* length); MOZ_MUST_USE bool ArrayShiftDense(JSContext* cx, HandleObject obj, MutableHandleValue rval); JSString* ArrayJoin(JSContext* cx, HandleObject array, HandleString sep); MOZ_MUST_USE bool SetArrayLength(JSContext* cx, HandleObject obj, HandleValue value, bool strict); @@ -796,8 +797,8 @@ ForcedRecompile(JSContext* cx); JSString* StringReplace(JSContext* cx, HandleString string, HandleString pattern, HandleString repl); -MOZ_MUST_USE bool SetDenseOrUnboxedArrayElement(JSContext* cx, HandleObject obj, int32_t index, - HandleValue value, bool strict); +MOZ_MUST_USE bool SetDenseElement(JSContext* cx, HandleNativeObject obj, int32_t index, + HandleValue value, bool strict); void AssertValidObjectPtr(JSContext* cx, JSObject* obj); void AssertValidObjectOrNullPtr(JSContext* cx, JSObject* obj); diff --git a/js/src/jit/arm/Assembler-arm.cpp b/js/src/jit/arm/Assembler-arm.cpp index c0cb7dfb450e..76f2d37f7ccc 100644 --- a/js/src/jit/arm/Assembler-arm.cpp +++ b/js/src/jit/arm/Assembler-arm.cpp @@ -2272,24 +2272,44 @@ Assembler::PatchConstantPoolLoad(void* loadAddr, void* constPoolAddr) // Atomic instruction stuff: +BufferOffset +Assembler::as_ldrexd(Register rt, Register rt2, Register rn, Condition c) +{ + MOZ_ASSERT(!(rt.code() & 1) && rt2.code() == rt.code()+1); + MOZ_ASSERT(rt.code() != 14 && rn.code() != 15); + return writeInst(0x01b00f9f | (int)c | RT(rt) | RN(rn)); +} + BufferOffset Assembler::as_ldrex(Register rt, Register rn, Condition c) { + MOZ_ASSERT(rt.code() != 15 && rn.code() != 15); return writeInst(0x01900f9f | (int)c | RT(rt) | RN(rn)); } BufferOffset Assembler::as_ldrexh(Register rt, Register rn, Condition c) { + MOZ_ASSERT(rt.code() != 15 && rn.code() != 15); return writeInst(0x01f00f9f | (int)c | RT(rt) | RN(rn)); } BufferOffset Assembler::as_ldrexb(Register rt, Register rn, Condition c) { + MOZ_ASSERT(rt.code() != 15 && rn.code() != 15); return writeInst(0x01d00f9f | (int)c | RT(rt) | RN(rn)); } +BufferOffset +Assembler::as_strexd(Register rd, Register rt, Register rt2, Register rn, Condition c) +{ + MOZ_ASSERT(!(rt.code() & 1) && rt2.code() == rt.code()+1); + MOZ_ASSERT(rt.code() != 14 && rn.code() != 15 && rd.code() != 15); + MOZ_ASSERT(rd != rn && rd != rt && rd != rt2); + return writeInst(0x01a00f90 | (int)c | RD(rd) | RN(rn) | rt.code()); +} + BufferOffset Assembler::as_strex(Register rd, Register rt, Register rn, Condition c) { @@ -2311,6 +2331,12 @@ Assembler::as_strexb(Register rd, Register rt, Register rn, Condition c) return writeInst(0x01c00f90 | (int)c | RD(rd) | RN(rn) | rt.code()); } +BufferOffset +Assembler::as_clrex() +{ + return writeInst(0xf57ff01f); +} + // Memory barrier stuff: BufferOffset diff --git a/js/src/jit/arm/Assembler-arm.h b/js/src/jit/arm/Assembler-arm.h index fc892eb0b669..f137c6d6a928 100644 --- a/js/src/jit/arm/Assembler-arm.h +++ b/js/src/jit/arm/Assembler-arm.h @@ -1560,23 +1560,32 @@ class Assembler : public AssemblerShared // Load a 32 bit floating point immediate from a pool into a register. BufferOffset as_FImm32Pool(VFPRegister dest, float value, Condition c = Always); - // Atomic instructions: ldrex, ldrexh, ldrexb, strex, strexh, strexb. + // Atomic instructions: ldrexd, ldrex, ldrexh, ldrexb, strexd, strex, strexh, strexb. // - // The halfword and byte versions are available from ARMv6K forward. + // The doubleword, halfword, and byte versions are available from ARMv6K forward. // // The word versions are available from ARMv6 forward and can be used to // implement the halfword and byte versions on older systems. + // LDREXD rt, rt2, [rn]. Constraint: rt even register, rt2=rt+1. + BufferOffset as_ldrexd(Register rt, Register rt2, Register rn, Condition c = Always); + // LDREX rt, [rn] BufferOffset as_ldrex(Register rt, Register rn, Condition c = Always); BufferOffset as_ldrexh(Register rt, Register rn, Condition c = Always); BufferOffset as_ldrexb(Register rt, Register rn, Condition c = Always); + // STREXD rd, rt, rt2, [rn]. Constraint: rt even register, rt2=rt+1. + BufferOffset as_strexd(Register rd, Register rt, Register rt2, Register rn, Condition c = Always); + // STREX rd, rt, [rn]. Constraint: rd != rn, rd != rt. BufferOffset as_strex(Register rd, Register rt, Register rn, Condition c = Always); BufferOffset as_strexh(Register rd, Register rt, Register rn, Condition c = Always); BufferOffset as_strexb(Register rd, Register rt, Register rn, Condition c = Always); + // CLREX + BufferOffset as_clrex(); + // Memory synchronization. // These are available from ARMv7 forward. BufferOffset as_dmb(BarrierOption option = BarrierSY); diff --git a/js/src/jit/arm/Simulator-arm.cpp b/js/src/jit/arm/Simulator-arm.cpp index 096e066ef53f..fb0708288b58 100644 --- a/js/src/jit/arm/Simulator-arm.cpp +++ b/js/src/jit/arm/Simulator-arm.cpp @@ -1986,33 +1986,33 @@ Simulator::writeDW(int32_t addr, int32_t value1, int32_t value2) int32_t Simulator::readExDW(int32_t addr, int32_t* hibits) { -#if defined(__clang__) && defined(__i386) - // This is OK for now, we don't yet generate LDREXD. - MOZ_CRASH("Unimplemented - 8-byte atomics are unsupported in Clang on i386"); -#else if ((addr & 3) == 0) { SharedMem ptr = SharedMem::shared(reinterpret_cast(addr)); + // The spec says that the low part of value shall be read from addr and + // the high part shall be read from addr+4. On a little-endian system + // where we read a 64-bit quadword the low part of the value will be in + // the low part of the quadword, and the high part of the value in the + // high part of the quadword. uint64_t value = loadRelaxed(ptr); exclusiveMonitorSet(value); - *hibits = int32_t(value); - return int32_t(value >> 32); + *hibits = int32_t(value >> 32); + return int32_t(value); } printf("Unaligned read at 0x%08x\n", addr); MOZ_CRASH(); return 0; -#endif } int32_t Simulator::writeExDW(int32_t addr, int32_t value1, int32_t value2) { -#if defined(__clang__) && defined(__i386) - // This is OK for now, we don't yet generate STREXD. - MOZ_CRASH("Unimplemented - 8-byte atomics are unsupported in Clang on i386"); -#else if ((addr & 3) == 0) { SharedMem ptr = SharedMem::shared(reinterpret_cast(addr)); - uint64_t value = (uint64_t(value1) << 32) | uint32_t(value2); + // The spec says that value1 shall be stored at addr and value2 at + // addr+4. On a little-endian system that means constructing a 64-bit + // value where value1 is in the low half of a 64-bit quadword and value2 + // is in the high half of the quadword. + uint64_t value = (uint64_t(value2) << 32) | uint32_t(value1); bool held; uint64_t expected = exclusiveMonitorGetAndClear(&held); if (!held) @@ -2023,7 +2023,6 @@ Simulator::writeExDW(int32_t addr, int32_t value1, int32_t value2) printf("Unaligned write at 0x%08x\n", addr); MOZ_CRASH(); } -#endif } uintptr_t @@ -4689,6 +4688,9 @@ Simulator::decodeSpecialCondition(SimInstruction* instr) case 0xA: if (instr->bits(31,20) == 0xf57) { switch (instr->bits(7,4)) { + case 1: // CLREX + exclusiveMonitorClear(); + break; case 5: // DMB AtomicOperations::fenceSeqCst(); break; diff --git a/js/src/jit/arm/disasm/Disasm-arm.cpp b/js/src/jit/arm/disasm/Disasm-arm.cpp index 8bd7bff0c283..ef6aa4b2caa0 100644 --- a/js/src/jit/arm/disasm/Disasm-arm.cpp +++ b/js/src/jit/arm/disasm/Disasm-arm.cpp @@ -1891,6 +1891,9 @@ Decoder::DecodeSpecialCondition(Instruction* instr) case 15: option = "sy"; break; } switch (instr->Bits(7, 4)) { + case 1: + Print("clrex"); + break; case 4: out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "dsb %s", option); diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 13bf1192adb2..efb6ae8703e8 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -3677,7 +3677,7 @@ CloneFunctionObject(JSContext* cx, HandleObject funobj, HandleObject env, Handle return nullptr; } - if (IsAsmJSModule(fun)) { + if (IsAsmJSModule(fun) || wasm::IsExportedFunction(fun)) { JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_CANT_CLONE_OBJECT); return nullptr; } diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 8f96c60983db..99eb46eb281a 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -338,8 +338,8 @@ ElementAdder::append(JSContext* cx, HandleValue v) { MOZ_ASSERT(index_ < length_); if (resObj_) { - DenseElementResult result = - SetOrExtendBoxedOrUnboxedDenseElements(cx, resObj_, index_, v.address(), 1); + NativeObject* resObj = &resObj_->as(); + DenseElementResult result = resObj->setOrExtendDenseElements(cx, index_, v.address(), 1); if (result == DenseElementResult::Failure) return false; if (result == DenseElementResult::Incomplete) { @@ -1491,9 +1491,9 @@ SetArrayElements(JSContext* cx, HandleObject obj, uint64_t start, return true; if (!ObjectMayHaveExtraIndexedProperties(obj) && start <= UINT32_MAX) { - DenseElementResult result = - SetOrExtendBoxedOrUnboxedDenseElements(cx, obj, uint32_t(start), vector, count, - updateTypes); + NativeObject* nobj = &obj->as(); + DenseElementResult result = nobj->setOrExtendDenseElements(cx, uint32_t(start), vector, + count, updateTypes); if (result != DenseElementResult::Incomplete) return result == DenseElementResult::Success; } @@ -2283,8 +2283,8 @@ js::array_push(JSContext* cx, unsigned argc, Value* vp) if (!ObjectMayHaveExtraIndexedProperties(obj) && length <= UINT32_MAX) { DenseElementResult result = - SetOrExtendBoxedOrUnboxedDenseElements(cx, obj, uint32_t(length), - args.array(), args.length()); + obj->as().setOrExtendDenseElements(cx, uint32_t(length), + args.array(), args.length()); if (result != DenseElementResult::Incomplete) { if (result == DenseElementResult::Failure) return false; @@ -2292,9 +2292,8 @@ js::array_push(JSContext* cx, unsigned argc, Value* vp) uint32_t newlength = uint32_t(length) + args.length(); args.rval().setNumber(newlength); - // SetOrExtendAnyBoxedOrUnboxedDenseElements takes care of updating the - // length for boxed and unboxed arrays. Handle updates to the length of - // non-arrays here. + // setOrExtendDenseElements takes care of updating the length for + // arrays. Handle updates to the length of non-arrays here. if (!obj->is()) { MOZ_ASSERT(obj->is()); return SetLengthProperty(cx, obj, newlength); @@ -2381,6 +2380,20 @@ SetInitializedLength(JSContext* cx, NativeObject* obj, size_t initlen) obj->shrinkElements(cx, initlen); } +static DenseElementResult +MoveDenseElements(JSContext* cx, NativeObject* obj, uint32_t dstStart, uint32_t srcStart, + uint32_t length) +{ + if (obj->denseElementsAreFrozen()) + return DenseElementResult::Incomplete; + + if (!obj->maybeCopyElementsForWrite(cx)) + return DenseElementResult::Failure; + obj->moveDenseElements(dstStart, srcStart, length); + + return DenseElementResult::Success; +} + static DenseElementResult ArrayShiftDenseKernel(JSContext* cx, HandleObject obj, MutableHandleValue rval) { @@ -2401,7 +2414,7 @@ ArrayShiftDenseKernel(JSContext* cx, HandleObject obj, MutableHandleValue rval) if (obj->as().tryShiftDenseElements(1)) return DenseElementResult::Success; - DenseElementResult result = MoveBoxedOrUnboxedDenseElements(cx, obj, 0, 1, initlen - 1); + DenseElementResult result = MoveDenseElements(cx, &obj->as(), 0, 1, initlen - 1); if (result != DenseElementResult::Success) return result; @@ -2661,14 +2674,12 @@ CopyDenseArrayElements(JSContext* cx, HandleNativeObject obj, uint32_t begin, ui if (!narr) return nullptr; - MOZ_ASSERT(count >= narr->as().length()); - narr->as().setLength(cx, count); + MOZ_ASSERT(count >= narr->length()); + narr->setLength(cx, count); + + if (newlength > 0) + narr->initDenseElements(obj, begin, newlength); - if (newlength) { - DebugOnly result = - CopyBoxedOrUnboxedDenseElements(cx, narr, obj, 0, begin, newlength); - MOZ_ASSERT(result.value == DenseElementResult::Success); - } return narr; } @@ -2856,16 +2867,16 @@ array_splice_impl(JSContext* cx, unsigned argc, Value* vp, bool returnValueIsUse MOZ_ASSERT(sourceIndex <= len && targetIndex <= len && len <= UINT32_MAX, "sourceIndex and targetIndex are uint32 array indices"); MOZ_ASSERT(finalLength < len, "finalLength is strictly less than len"); + MOZ_ASSERT(obj->isNative()); /* Steps 15.a-b. */ if (targetIndex != 0 || - !obj->is() || !obj->as().tryShiftDenseElements(sourceIndex)) { - DenseElementResult result = - MoveBoxedOrUnboxedDenseElements(cx, obj, uint32_t(targetIndex), - uint32_t(sourceIndex), - uint32_t(len - sourceIndex)); + DenseElementResult result = MoveDenseElements(cx, &obj->as(), + uint32_t(targetIndex), + uint32_t(sourceIndex), + uint32_t(len - sourceIndex)); MOZ_ASSERT(result != DenseElementResult::Incomplete); if (result == DenseElementResult::Failure) return false; @@ -2962,10 +2973,10 @@ array_splice_impl(JSContext* cx, unsigned argc, Value* vp, bool returnValueIsUse uint32_t start = uint32_t(actualStart); uint32_t length = uint32_t(len); - DenseElementResult result = - MoveBoxedOrUnboxedDenseElements(cx, obj, start + itemCount, - start + deleteCount, - length - (start + deleteCount)); + DenseElementResult result = MoveDenseElements(cx, &obj->as(), + start + itemCount, + start + deleteCount, + length - (start + deleteCount)); MOZ_ASSERT(result != DenseElementResult::Incomplete); if (result == DenseElementResult::Failure) return false; @@ -3336,10 +3347,10 @@ ArraySliceDenseKernel(JSContext* cx, ArrayObject* arr, int32_t beginArg, int32_t size_t initlen = arr->getDenseInitializedLength(); if (initlen > begin) { uint32_t newlength = Min(initlen - begin, count); - if (newlength) { + if (newlength > 0) { if (!result->ensureElements(cx, newlength)) return false; - CopyBoxedOrUnboxedDenseElements(cx, result, arr, 0, begin, newlength); + result->initDenseElements(arr, begin, newlength); } } @@ -3844,11 +3855,10 @@ js::NewDenseCopiedArray(JSContext* cx, uint32_t length, const Value* values, return nullptr; MOZ_ASSERT(arr->getDenseCapacity() >= length); - - arr->setDenseInitializedLength(values ? length : 0); + MOZ_ASSERT(arr->getDenseInitializedLength() == 0); if (values) - arr->initDenseElements(0, values, length); + arr->initDenseElements(values, length); return arr; } @@ -4005,8 +4015,7 @@ js::NewCopiedArrayTryUseGroup(JSContext* cx, HandleObjectGroup group, if (!obj) return nullptr; - DenseElementResult result = - SetOrExtendBoxedOrUnboxedDenseElements(cx, obj, 0, vp, length, updateTypes); + DenseElementResult result = obj->setOrExtendDenseElements(cx, 0, vp, length, updateTypes); if (result == DenseElementResult::Failure) return nullptr; diff --git a/js/src/jsarray.h b/js/src/jsarray.h index 7c1b0fca0d48..09e3c18e3ebe 100644 --- a/js/src/jsarray.h +++ b/js/src/jsarray.h @@ -102,12 +102,6 @@ NewFullyAllocatedArrayForCallingAllocationSite(JSContext* cx, size_t length, extern ArrayObject* NewPartlyAllocatedArrayForCallingAllocationSite(JSContext* cx, size_t length, HandleObject proto); -enum class ShouldUpdateTypes -{ - Update, - DontUpdate -}; - extern ArrayObject* NewCopiedArrayTryUseGroup(JSContext* cx, HandleObjectGroup group, const Value* vp, size_t length, diff --git a/js/src/moz.build b/js/src/moz.build index 46608fa35e85..32e5dd465a1f 100755 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -646,6 +646,13 @@ if CONFIG['NIGHTLY_BUILD']: if CONFIG['NIGHTLY_BUILD']: DEFINES['ENABLE_WASM_THREAD_OPS'] = True +# Wasm code should use WASM_HUGE_MEMORY instead of JS_CODEGEN_X64 +# so that it is easy to use the huge-mapping optimization for other +# 64-bit platforms in the future. + +if CONFIG['JS_CODEGEN_X64']: + DEFINES['WASM_HUGE_MEMORY'] = True + if CONFIG['MOZ_DEBUG'] or CONFIG['NIGHTLY_BUILD']: DEFINES['JS_CACHEIR_SPEW'] = True diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index d34fb4575bab..03b92e0a6b9f 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -3047,14 +3047,13 @@ static bool Clone(JSContext* cx, unsigned argc, Value* vp) { CallArgs args = CallArgsFromVp(argc, vp); - RootedObject parent(cx); - RootedObject funobj(cx); - if (!args.length()) { + if (args.length() == 0) { JS_ReportErrorASCII(cx, "Invalid arguments to clone"); return false; } + RootedObject funobj(cx); { Maybe ac; RootedObject obj(cx, args[0].isPrimitive() ? nullptr : &args[0].toObject()); @@ -3074,19 +3073,20 @@ Clone(JSContext* cx, unsigned argc, Value* vp) } } + RootedObject env(cx); if (args.length() > 1) { - if (!JS_ValueToObject(cx, args[1], &parent)) + if (!JS_ValueToObject(cx, args[1], &env)) return false; } else { - parent = js::GetGlobalForObjectCrossCompartment(&args.callee()); + env = js::GetGlobalForObjectCrossCompartment(&args.callee()); } // Should it worry us that we might be getting with wrappers // around with wrappers here? - JS::AutoObjectVector scopeChain(cx); - if (!parent->is() && !scopeChain.append(parent)) + JS::AutoObjectVector envChain(cx); + if (env && !env->is() && !envChain.append(env)) return false; - JSObject* clone = JS::CloneFunctionObject(cx, funobj, scopeChain); + JSObject* clone = JS::CloneFunctionObject(cx, funobj, envChain); if (!clone) return false; args.rval().setObject(*clone); @@ -6213,6 +6213,10 @@ WasmLoop(JSContext* cx, unsigned argc, Value* vp) } static const JSFunctionSpecWithHelp shell_functions[] = { + JS_FN_HELP("clone", Clone, 1, 0, +"clone(fun[, scope])", +" Clone function object."), + JS_FN_HELP("version", Version, 0, 0, "version([number])", " Get or force a script compilation version number."), @@ -6694,10 +6698,6 @@ static const JSFunctionSpecWithHelp shell_functions[] = { }; static const JSFunctionSpecWithHelp fuzzing_unsafe_functions[] = { - JS_FN_HELP("clone", Clone, 1, 0, -"clone(fun[, scope])", -" Clone function object."), - JS_FN_HELP("getSelfHostedValue", GetSelfHostedValue, 1, 0, "getSelfHostedValue()", " Get a self-hosted value by its name. Note that these values don't get \n" diff --git a/js/src/vm/NativeObject-inl.h b/js/src/vm/NativeObject-inl.h index 4bcecd0d18af..9ccb8c0b90b8 100644 --- a/js/src/vm/NativeObject-inl.h +++ b/js/src/vm/NativeObject-inl.h @@ -158,17 +158,31 @@ NativeObject::copyDenseElements(uint32_t dstStart, const Value* src, uint32_t co } inline void -NativeObject::initDenseElements(uint32_t dstStart, const Value* src, uint32_t count) +NativeObject::initDenseElements(NativeObject* src, uint32_t srcStart, uint32_t count) { - MOZ_ASSERT(dstStart + count <= getDenseCapacity()); + MOZ_ASSERT(src->getDenseInitializedLength() >= srcStart + count); + + const Value* vp = src->getDenseElements() + srcStart; + initDenseElements(vp, count); +} + +inline void +NativeObject::initDenseElements(const Value* src, uint32_t count) +{ + MOZ_ASSERT(getDenseInitializedLength() == 0); + MOZ_ASSERT(count <= getDenseCapacity()); MOZ_ASSERT(!denseElementsAreCopyOnWrite()); MOZ_ASSERT(!denseElementsAreFrozen()); + + setDenseInitializedLength(count); + #ifdef DEBUG for (uint32_t i = 0; i < count; ++i) checkStoredValue(src[i]); #endif - memcpy(&elements_[dstStart], src, count * sizeof(HeapSlot)); - elementsRangeWriteBarrierPost(dstStart, count); + + memcpy(elements_, src, count * sizeof(HeapSlot)); + elementsRangeWriteBarrierPost(0, count); } inline bool @@ -382,6 +396,38 @@ NativeObject::ensureDenseElements(JSContext* cx, uint32_t index, uint32_t extra) return DenseElementResult::Success; } +inline DenseElementResult +NativeObject::setOrExtendDenseElements(JSContext* cx, uint32_t start, const Value* vp, + uint32_t count, + ShouldUpdateTypes updateTypes) +{ + if (denseElementsAreFrozen()) + return DenseElementResult::Incomplete; + + if (is() && + !as().lengthIsWritable() && + start + count >= as().length()) + { + return DenseElementResult::Incomplete; + } + + DenseElementResult result = ensureDenseElements(cx, start, count); + if (result != DenseElementResult::Success) + return result; + + if (is() && start + count >= as().length()) + as().setLengthInt32(start + count); + + if (updateTypes == ShouldUpdateTypes::DontUpdate && !shouldConvertDoubleElements()) { + copyDenseElements(start, vp, count); + } else { + for (size_t i = 0; i < count; i++) + setDenseElementWithType(cx, start + i, vp[i]); + } + + return DenseElementResult::Success; +} + inline Value NativeObject::getDenseOrTypedArrayElement(uint32_t idx) { diff --git a/js/src/vm/NativeObject.h b/js/src/vm/NativeObject.h index 55a495483115..f884df84a62b 100644 --- a/js/src/vm/NativeObject.h +++ b/js/src/vm/NativeObject.h @@ -406,6 +406,11 @@ enum class DenseElementResult { Incomplete }; +enum class ShouldUpdateTypes { + Update, + DontUpdate +}; + /* * NativeObject specifies the internal implementation of a native object. * @@ -1224,10 +1229,15 @@ class NativeObject : public ShapedObject inline Value getDenseOrTypedArrayElement(uint32_t idx); inline void copyDenseElements(uint32_t dstStart, const Value* src, uint32_t count); - inline void initDenseElements(uint32_t dstStart, const Value* src, uint32_t count); + inline void initDenseElements(const Value* src, uint32_t count); + inline void initDenseElements(NativeObject* src, uint32_t srcStart, uint32_t count); inline void moveDenseElements(uint32_t dstStart, uint32_t srcStart, uint32_t count); inline void moveDenseElementsNoPreBarrier(uint32_t dstStart, uint32_t srcStart, uint32_t count); + inline DenseElementResult + setOrExtendDenseElements(JSContext* cx, uint32_t start, const Value* vp, uint32_t count, + ShouldUpdateTypes updateTypes = ShouldUpdateTypes::Update); + bool shouldConvertDoubleElements() { return getElementsHeader()->shouldConvertDoubleElements(); } diff --git a/js/src/vm/UnboxedObject-inl.h b/js/src/vm/UnboxedObject-inl.h index 0fb6275f9c74..78b60606a5e2 100644 --- a/js/src/vm/UnboxedObject-inl.h +++ b/js/src/vm/UnboxedObject-inl.h @@ -168,78 +168,6 @@ UnboxedPlainObject::layout() const return group()->unboxedLayout(); } -///////////////////////////////////////////////////////////////////// -// Template methods for NativeObject and UnboxedArrayObject accesses. -///////////////////////////////////////////////////////////////////// - -static inline DenseElementResult -SetOrExtendBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* obj, - uint32_t start, const Value* vp, uint32_t count, - ShouldUpdateTypes updateTypes = ShouldUpdateTypes::Update) -{ - NativeObject* nobj = &obj->as(); - - if (nobj->denseElementsAreFrozen()) - return DenseElementResult::Incomplete; - - if (obj->is() && - !obj->as().lengthIsWritable() && - start + count >= obj->as().length()) - { - return DenseElementResult::Incomplete; - } - - DenseElementResult result = nobj->ensureDenseElements(cx, start, count); - if (result != DenseElementResult::Success) - return result; - - if (obj->is() && start + count >= obj->as().length()) - obj->as().setLengthInt32(start + count); - - if (updateTypes == ShouldUpdateTypes::DontUpdate && !nobj->shouldConvertDoubleElements()) { - nobj->copyDenseElements(start, vp, count); - } else { - for (size_t i = 0; i < count; i++) - nobj->setDenseElementWithType(cx, start + i, vp[i]); - } - - return DenseElementResult::Success; -} - -static inline DenseElementResult -MoveBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* obj, uint32_t dstStart, uint32_t srcStart, - uint32_t length) -{ - MOZ_ASSERT(obj->isNative()); - - if (obj->as().denseElementsAreFrozen()) - return DenseElementResult::Incomplete; - - if (!obj->as().maybeCopyElementsForWrite(cx)) - return DenseElementResult::Failure; - obj->as().moveDenseElements(dstStart, srcStart, length); - - return DenseElementResult::Success; -} - -static inline DenseElementResult -CopyBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* dst, JSObject* src, - uint32_t dstStart, uint32_t srcStart, uint32_t length) -{ - MOZ_ASSERT(src->isNative()); - MOZ_ASSERT(dst->isNative()); - MOZ_ASSERT(dst->as().getDenseInitializedLength() == dstStart); - MOZ_ASSERT(src->as().getDenseInitializedLength() >= srcStart + length); - MOZ_ASSERT(dst->as().getDenseCapacity() >= dstStart + length); - - dst->as().setDenseInitializedLength(dstStart + length); - - const Value* vp = src->as().getDenseElements() + srcStart; - dst->as().initDenseElements(dstStart, vp, length); - - return DenseElementResult::Success; -} - } // namespace js #endif // vm_UnboxedObject_inl_h diff --git a/js/src/wasm/WasmTypes.cpp b/js/src/wasm/WasmTypes.cpp index af742fbf26b6..01ddc558d170 100644 --- a/js/src/wasm/WasmTypes.cpp +++ b/js/src/wasm/WasmTypes.cpp @@ -30,6 +30,13 @@ using namespace js::wasm; using mozilla::IsPowerOfTwo; +// A sanity check. We have only tested WASM_HUGE_MEMORY on x64, and only tested +// x64 with WASM_HUGE_MEMORY. + +#if defined(WASM_HUGE_MEMORY) != defined(JS_CODEGEN_X64) +# error "Not an expected configuration" +#endif + void Val::writePayload(uint8_t* dst) const { diff --git a/js/src/wasm/WasmTypes.h b/js/src/wasm/WasmTypes.h index 9650c0995a4d..b72fbcad650b 100644 --- a/js/src/wasm/WasmTypes.h +++ b/js/src/wasm/WasmTypes.h @@ -1650,12 +1650,7 @@ static const unsigned PageSize = 64 * 1024; static const unsigned MaxMemoryAccessSize = sizeof(Val); -#ifdef JS_CODEGEN_X64 - -// All other code should use WASM_HUGE_MEMORY instead of JS_CODEGEN_X64 so that -// it is easy to use the huge-mapping optimization for other 64-bit platforms in -// the future. -# define WASM_HUGE_MEMORY +#ifdef WASM_HUGE_MEMORY // On WASM_HUGE_MEMORY platforms, every asm.js or WebAssembly memory // unconditionally allocates a huge region of virtual memory of size diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp index 5e664d02d940..8aa9623a9eb4 100644 --- a/layout/base/ServoRestyleManager.cpp +++ b/layout/base/ServoRestyleManager.cpp @@ -78,6 +78,12 @@ ExpectedOwnerForChild(const nsIFrame& aFrame) return parent; } + if (aFrame.IsLetterFrame()) { + // Ditto for ::first-letter. A first-letter always arrives here via its + // direct parent, except when it's parented to a ::first-line. + return parent->IsLineFrame() ? parent->GetParent() : parent; + } + parent = FirstContinuationOrPartOfIBSplit(parent); // We've handled already anon boxes and bullet frames, so now we're looking at @@ -567,6 +573,8 @@ UpdateBackdropIfNeeded(nsIFrame* aFrame, static void UpdateFirstLetterIfNeeded(nsIFrame* aFrame, ServoRestyleState& aRestyleState) { + MOZ_ASSERT(!aFrame->IsFrameOfType(nsIFrame::eBlockFrame), + "You're probably duplicating work with UpdatePseudoElementStyles!"); if (!aFrame->HasFirstLetterChild()) { return; } @@ -574,10 +582,11 @@ UpdateFirstLetterIfNeeded(nsIFrame* aFrame, ServoRestyleState& aRestyleState) // We need to find the block the first-letter is associated with so we can // find the right element for the first-letter's style resolution. Might as // well just delegate the whole thing to that block. - nsIFrame* block = aFrame; + nsIFrame* block = aFrame->GetParent(); while (!block->IsFrameOfType(nsIFrame::eBlockFrame)) { block = block->GetParent(); } + static_cast(block->FirstContinuation())-> UpdateFirstLetterStyle(aRestyleState); } @@ -638,12 +647,10 @@ static void UpdateFramePseudoElementStyles(nsIFrame* aFrame, ServoRestyleState& aRestyleState) { - // first-letter needs to be updated before first-line, because first-line can - // change the style of the first-letter. - UpdateFirstLetterIfNeeded(aFrame, aRestyleState); - if (aFrame->IsFrameOfType(nsIFrame::eBlockFrame)) { static_cast(aFrame)->UpdatePseudoElementStyles(aRestyleState); + } else { + UpdateFirstLetterIfNeeded(aFrame, aRestyleState); } UpdateBackdropIfNeeded( diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index bdcceb5899c1..0a73029e11e8 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -7581,6 +7581,12 @@ nsBlockFrame::ResolveBidi() void nsBlockFrame::UpdatePseudoElementStyles(ServoRestyleState& aRestyleState) { + // first-letter needs to be updated before first-line, because first-line can + // change the style of the first-letter. + if (HasFirstLetterChild()) { + UpdateFirstLetterStyle(aRestyleState); + } + if (nsBulletFrame* bullet = GetBullet()) { CSSPseudoElementType type = bullet->StyleContext()->GetPseudoType(); RefPtr newBulletStyle = diff --git a/layout/reftests/first-letter/1404167-1-ref.html b/layout/reftests/first-letter/1404167-1-ref.html new file mode 100644 index 000000000000..44f20b89df1d --- /dev/null +++ b/layout/reftests/first-letter/1404167-1-ref.html @@ -0,0 +1,12 @@ + + + + The first-letter size should be 45px + diff --git a/layout/reftests/first-letter/1404167-1.html b/layout/reftests/first-letter/1404167-1.html new file mode 100644 index 000000000000..2c7b24148867 --- /dev/null +++ b/layout/reftests/first-letter/1404167-1.html @@ -0,0 +1,16 @@ + + + + The first-letter size should be 45px + + diff --git a/layout/reftests/first-letter/1404167-2-ref.html b/layout/reftests/first-letter/1404167-2-ref.html new file mode 100644 index 000000000000..a756034b2823 --- /dev/null +++ b/layout/reftests/first-letter/1404167-2-ref.html @@ -0,0 +1,13 @@ + + + + + + +
+ This text should have a green border on the first letter. +
diff --git a/layout/reftests/first-letter/1404167-2.html b/layout/reftests/first-letter/1404167-2.html new file mode 100644 index 000000000000..70f7c0f29a68 --- /dev/null +++ b/layout/reftests/first-letter/1404167-2.html @@ -0,0 +1,18 @@ + + + + + + +
+ This text should have a green border on the first letter. +
+ diff --git a/layout/reftests/first-letter/1404167-3-ref.html b/layout/reftests/first-letter/1404167-3-ref.html new file mode 100644 index 000000000000..c2646a66a4f3 --- /dev/null +++ b/layout/reftests/first-letter/1404167-3-ref.html @@ -0,0 +1,9 @@ + + +
+ This text should have a green border on the first letter. +
diff --git a/layout/reftests/first-letter/1404167-3.html b/layout/reftests/first-letter/1404167-3.html new file mode 100644 index 000000000000..e81587450066 --- /dev/null +++ b/layout/reftests/first-letter/1404167-3.html @@ -0,0 +1,14 @@ + + +
+ This text should have a green border on the first letter. +
+ diff --git a/layout/reftests/first-letter/1404167-4-ref.html b/layout/reftests/first-letter/1404167-4-ref.html new file mode 100644 index 000000000000..b08c8a24f575 --- /dev/null +++ b/layout/reftests/first-letter/1404167-4-ref.html @@ -0,0 +1,11 @@ + + +
My first letter should be green, and the whole line 20px in size
diff --git a/layout/reftests/first-letter/1404167-4.html b/layout/reftests/first-letter/1404167-4.html new file mode 100644 index 000000000000..daa864301516 --- /dev/null +++ b/layout/reftests/first-letter/1404167-4.html @@ -0,0 +1,16 @@ + + +
My first letter should be green, and the whole line 20px in size
+ diff --git a/layout/reftests/first-letter/reftest.list b/layout/reftests/first-letter/reftest.list index dcf36aad54ec..5b25a1bcca75 100644 --- a/layout/reftests/first-letter/reftest.list +++ b/layout/reftests/first-letter/reftest.list @@ -75,3 +75,7 @@ HTTP(..) == indic-clusters-1.html indic-clusters-1-ref.html == overflow-inline-overflow.html overflow-inline-overflow-ref.html == 1385656.html 1385656-ref.html +== 1404167-1.html 1404167-1-ref.html +== 1404167-2.html 1404167-2-ref.html +== 1404167-3.html 1404167-3-ref.html +== 1404167-4.html 1404167-4-ref.html diff --git a/layout/tools/reftest/remotereftest.py b/layout/tools/reftest/remotereftest.py index e59e384f0753..266159697088 100644 --- a/layout/tools/reftest/remotereftest.py +++ b/layout/tools/reftest/remotereftest.py @@ -6,6 +6,7 @@ from contextlib import closing import sys import logging import os +import psutil import signal import time import tempfile @@ -14,7 +15,6 @@ import urllib2 import mozdevice import mozinfo -import mozprocess from automation import Automation from remoteautomation import RemoteAutomation, fennecLogcatFilters @@ -240,34 +240,25 @@ class RemoteReftest(RefTest): def stopWebServer(self, options): self.server.stop() - def killNamedProc(self, pname): + def killNamedProc(self, pname, orphans=True): """ Kill processes matching the given command name """ self.log.info("Checking for %s processes..." % pname) - def _psInfo(line): - if pname in line: - self.log.info(line) - process = mozprocess.ProcessHandler(['ps', '-f'], - processOutputLine=_psInfo) - process.run() - process.wait() - - def _psKill(line): - parts = line.split() - if len(parts) == 3 and parts[0].isdigit(): - pid = int(parts[0]) - if parts[2] == pname: - self.log.info("killing %s with pid %d" % (pname, pid)) - try: - os.kill( - pid, getattr(signal, "SIGKILL", signal.SIGTERM)) - except Exception as e: - self.log.info("Failed to kill process %d: %s" % - (pid, str(e))) - process = mozprocess.ProcessHandler(['ps', '-o', 'pid,ppid,comm'], - processOutputLine=_psKill) - process.run() - process.wait() + for proc in psutil.process_iter(): + try: + if proc.name() == pname: + procd = proc.as_dict(attrs=['pid', 'ppid', 'name', 'username']) + if proc.ppid() == 1 or not orphans: + self.log.info("killing %s" % procd) + try: + os.kill(proc.pid, getattr(signal, "SIGKILL", signal.SIGTERM)) + except Exception as e: + self.log.info("Failed to kill process %d: %s" % (proc.pid, str(e))) + else: + self.log.info("NOT killing %s (not an orphan?)" % procd) + except: + # may not be able to access process info for all processes + continue def createReftestProfile(self, options, manifest, startAfter=None): profile = RefTest.createReftestProfile(self, diff --git a/media/webrtc/trunk/webrtc/base/platform_thread.cc b/media/webrtc/trunk/webrtc/base/platform_thread.cc index 59f5e5e27d26..8ae587c3de20 100644 --- a/media/webrtc/trunk/webrtc/base/platform_thread.cc +++ b/media/webrtc/trunk/webrtc/base/platform_thread.cc @@ -274,6 +274,8 @@ void PlatformUIThread::Stop() { PostMessage(hwnd_, WM_CLOSE, 0, 0); + hwnd_ = NULL; + PlatformThread::Stop(); } #endif diff --git a/memory/build/rb.h b/memory/build/rb.h index 0ff725a40a44..8eb8d7937ab1 100644 --- a/memory/build/rb.h +++ b/memory/build/rb.h @@ -563,14 +563,13 @@ private: rbp_r_p->SetRight(rbp_r_t); } break; - } else { - /* This is the node we want to delete, but we - * will instead swap it with its successor - * and delete the successor. Record enough - * information to do the swap later. - * rbp_r_xp is aNode's parent. */ - rbp_r_xp = rbp_r_p; } + /* This is the node we want to delete, but we + * will instead swap it with its successor + * and delete the successor. Record enough + * information to do the swap later. + * rbp_r_xp is aNode's parent. */ + rbp_r_xp = rbp_r_p; } rbp_r_t = rbp_r_c->Right(); rbp_r_u = rbp_r_t->Left(); diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index d3ac3d496625..de4aa46843e8 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -5906,5 +5906,9 @@ pref("toolkit.crashreporter.include_context_heap", true); // Open noopener links in a new process pref("dom.noopener.newprocess.enabled", true); +#ifdef XP_WIN +pref("layers.omtp.enabled", true); +#else pref("layers.omtp.enabled", false); +#endif pref("layers.omtp.force-sync", false); diff --git a/security/manager/ssl/StaticHPKPins.h b/security/manager/ssl/StaticHPKPins.h index 1152874a0296..9c657e6dce4d 100644 --- a/security/manager/ssl/StaticHPKPins.h +++ b/security/manager/ssl/StaticHPKPins.h @@ -1140,4 +1140,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = { static const int32_t kUnknownId = -1; -static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1515000916175000); +static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1515173442818000); diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp index 8c250e15eed1..a5749a0c69c5 100644 --- a/security/manager/ssl/nsNSSComponent.cpp +++ b/security/manager/ssl/nsNSSComponent.cpp @@ -13,7 +13,6 @@ #include "SharedSSLState.h" #include "cert.h" #include "certdb.h" -#include "mozStorageCID.h" #include "mozilla/ArrayUtils.h" #include "mozilla/Assertions.h" #include "mozilla/Casting.h" @@ -2263,14 +2262,6 @@ nsNSSComponent::Init() return NS_ERROR_NOT_AVAILABLE; } - // To avoid a sqlite3_config race in NSS init, as a workaround for - // bug 730495, we require the storage service to get initialized first. - nsCOMPtr storageService = - do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID); - if (!storageService) { - return NS_ERROR_NOT_AVAILABLE; - } - MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Beginning NSS initialization\n")); nsresult rv = InitializePIPNSSBundle(); diff --git a/security/manager/ssl/nsSTSPreloadList.errors b/security/manager/ssl/nsSTSPreloadList.errors index f66d298bb6e0..c0467eb05604 100644 --- a/security/manager/ssl/nsSTSPreloadList.errors +++ b/security/manager/ssl/nsSTSPreloadList.errors @@ -1,98 +1,149 @@ -0x00ff00ff.com: could not connect to host +27728522.com: could not connect to host 8887999.com: could not connect to host abolition.co: could not connect to host acrossgw.com: could not connect to host -adorecricket.com: could not connect to host -anticapitalist.party: could not connect to host +anarchistischegroepnijmegen.nl: could not connect to host arent.kz: could not connect to host ascii.moe: could not connect to host astral.gq: could not connect to host +avi9526.pp.ua: could not connect to host azabani.com: could not connect to host balonmano.co: could not connect to host +beamitapp.com: could not connect to host berna.fr: could not connect to host berr.yt: could not connect to host -burroughsid.com: could not connect to host -bvalle.com: could not connect to host +billdestler.com: could not connect to host +boomsaki.com: could not connect to host +boomsakis.com: could not connect to host by1898.com: could not connect to host caceis.bank: could not connect to host -diymediahome.org: could not connect to host +carloshmm.stream: could not connect to host +cdeck.net: could not connect to host +cfcnexus.org: could not connect to host +cirfi.com: could not connect to host +cpaneltips.com: could not connect to host +crapouill.es: could not connect to host +cyberxpert.nl: could not connect to host +czlx.co: could not connect to host +defme.eu: could not connect to host +dingcc.org: could not connect to host dreizwosechs.de: could not connect to host +drgn.no: could not connect to host ectora.com: could not connect to host edit.yahoo.com: could not connect to host +edwar.do: could not connect to host estan.cn: could not connect to host +etath.com: could not connect to host etaxi.tn: could not connect to host +eurostrategy.vn.ua: could not connect to host exceltobarcode.com: could not connect to host -ff14-mstdn.xyz: could not connect to host +fdlibre.eu: could not connect to host +festival.house: could not connect to host firebaseio.com: could not connect to host -fluxfingers.net: could not connect to host -flyss.net: could not connect to host forextimes.ru: could not connect to host -fukuoka-cityliner.jp: could not connect to host fuliydys.com: could not connect to host funfunmstdn.tokyo: could not connect to host g4w.co: could not connect to host +gam3rs.de: could not connect to host genealorand.com: could not connect to host getwarden.net: could not connect to host gfoss.gr: could not connect to host +girlsnet.work: could not connect to host gongjuhao.com: could not connect to host google: could not connect to host +gorf.chat: could not connect to host +gorf.club: could not connect to host gritte.net: could not connect to host gvt2.com: could not connect to host gvt3.com: could not connect to host -gypsyreel.com: could not connect to host hetmer.com: could not connect to host hetmer.cz: could not connect to host hetmer.net: could not connect to host -ingalabs.hu: could not connect to host +hg881.com: could not connect to host +holidayincotswolds.co.uk: could not connect to host javascriptlab.fr: could not connect to host -jonscaife.com: could not connect to host kenrogers.co: could not connect to host -lcht.ch: could not connect to host +lacasa.fr: could not connect to host +ladylucks.co.uk: could not connect to host legitaxi.com: could not connect to host -legland.fr: could not connect to host lezdomsm.com: could not connect to host +living-space.co.nz: could not connect to host livnev.me: could not connect to host +logcat.info: could not connect to host logimagine.com: could not connect to host +macedopesca.com.br: could not connect to host +maco.org.uk: could not connect to host +mario.party: could not connect to host +martinrogalla.com: could not connect to host +mastodon.blue: could not connect to host +matillat.ovh: could not connect to host +mcea-hld.jp: could not connect to host mecanicadom.com: could not connect to host +metachris.com: could not connect to host +mitsu-szene.de: could not connect to host +mrmoregame.de: could not connect to host +mzlog.win: could not connect to host ncdesigns-studio.com: could not connect to host necesitodinero.org: could not connect to host -nedcf.org.uk: could not connect to host -nevolution.me: could not connect to host +nex.sx: could not connect to host +notadd.store: could not connect to host +notarobot.fr: could not connect to host nqesh.com: could not connect to host -open-sauce-recipes.co.uk: could not connect to host -penfold.fr: could not connect to host +nsbfalconacademy.org: could not connect to host +nzmk.cz: could not connect to host +oxygaming.com: could not connect to host +oxymc.com: could not connect to host +palationtrade.com: could not connect to host +pe-bank.co.jp: could not connect to host perkbrian.com: could not connect to host +piwko.co: could not connect to host polit.im: could not connect to host -premiership-predictors.co.uk: could not connect to host -queenshaflo.com: could not connect to host +pythia.nz: could not connect to host +real-compare.com: could not connect to host +reality0ne.com: could not connect to host reignsphere.net: could not connect to host +reorz.com: could not connect to host rmit.me: could not connect to host -royalpalacenogent.fr: could not connect to host -santojuken.co.jp: could not connect to host -shenyuqi.com: could not connect to host -shirakaba-cc.com: could not connect to host +rmstudio.tw: could not connect to host +rofrank.space: could not connect to host +samirnassar.com: could not connect to host +seanstrout.com: could not connect to host +skyvault.io: could not connect to host slaughterhouse.fr: could not connect to host -smartviewing.com: could not connect to host somali-derp.com: could not connect to host -tcpweb.net: could not connect to host +soubriquet.org: could not connect to host +sviz.pro: could not connect to host tenispopular.com: could not connect to host -twit-guide.com: could not connect to host -ugcdn.com: could not connect to host -vbh2o.com: could not connect to host -vialorran.com: could not connect to host -voidptr.eu: could not connect to host -web-wave.jp: could not connect to host +testadren.com: could not connect to host +testadron.com: could not connect to host +tiliaze.info: could not connect to host +tiliaze.net: could not connect to host +tkat.ch: could not connect to host +tooti.biz: could not connect to host +totot.net: could not connect to host +transcendmotor.sg: could not connect to host +valasi.eu: could not connect to host +varunpriolkar.com: could not connect to host +waffle.at: could not connect to host +watchweasel.com: could not connect to host webart-factory.de: could not connect to host +webduck.nl: could not connect to host +wordpresspro.cl: could not connect to host www-8887999.com: could not connect to host xecureit.com: could not connect to host +xyfun.net: could not connect to host +zberger.com: could not connect to host zenfusion.fr: could not connect to host +zzw.ca: could not connect to host 0005.com: could not connect to host 0005aa.com: could not connect to host 007sascha.de: did not receive HSTS header -020wifi.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 119" data: no] +020wifi.nl: could not connect to host 0222aa.com: did not receive HSTS header 048.ag: could not connect to host -0f.io: did not receive HSTS header +050508.com: did not receive HSTS header +0day.su: did not receive HSTS header +0f.io: could not connect to host 0g.org.uk: could not connect to host 0o0.ooo: could not connect to host 0p.no: did not receive HSTS header @@ -124,6 +175,7 @@ zenfusion.fr: could not connect to host 12vpn.org: could not connect to host 12vpnchina.com: could not connect to host 13826145000.com: could not connect to host +1391kj.com: did not receive HSTS header 1396.net: could not connect to host 1536.cf: could not connect to host 163pwd.com: could not connect to host @@ -150,6 +202,7 @@ zenfusion.fr: could not connect to host 21.co.uk: did not receive HSTS header 21lg.co: could not connect to host 22228522.com: could not connect to host +247quickbooks.com: did not receive HSTS header 24hourpaint.com: could not connect to host 24sihu.com: could not connect to host 25daysof.io: could not connect to host @@ -166,6 +219,7 @@ zenfusion.fr: could not connect to host 300mbmovies4u.cc: could not connect to host 301.website: could not connect to host 302.nyc: could not connect to host +314166.com: did not receive HSTS header 32ph.com: could not connect to host 33338522.com: could not connect to host 3338522.com: could not connect to host @@ -207,6 +261,7 @@ zenfusion.fr: could not connect to host 4sqsu.eu: could not connect to host 4w-performers.link: could not connect to host 50millionablaze.org: could not connect to host +517vpn.cn: did not receive HSTS header 540.co: did not receive HSTS header 54bf.com: could not connect to host 55558522.com: could not connect to host @@ -329,6 +384,7 @@ acr.im: could not connect to host acrepairdrippingsprings.com: could not connect to host acritelli.com: did not receive HSTS header acslimited.co.uk: did not receive HSTS header +actgruppe.de: did not receive HSTS header activateplay.com: max-age too low: 86400 active-escape.com: could not connect to host activeweb.top: could not connect to host @@ -396,7 +452,6 @@ agonswim.com: could not connect to host agrimap.com: did not receive HSTS header agrios.de: could not connect to host agro-id.gov.ua: did not receive HSTS header -agroglass.com.br: did not receive HSTS header agtv.com.br: did not receive HSTS header ahabingo.com: did not receive HSTS header ahoynetwork.com: did not receive HSTS header @@ -428,7 +483,7 @@ akgundemirbas.com: could not connect to host akhilindurti.com: could not connect to host akkadia.cc: could not connect to host akoch.net: could not connect to host -akombakom.net: did not receive HSTS header +akombakom.net: could not connect to host akselimedia.fi: did not receive HSTS header aktivist.in: did not receive HSTS header al-shami.net: could not connect to host @@ -464,7 +519,7 @@ alfa24.pro: could not connect to host alfredxing.com: did not receive HSTS header alilialili.ga: could not connect to host alittlebitcheeky.com: did not receive HSTS header -aljmz.com: did not receive HSTS header +aljmz.com: could not connect to host alkami.com: did not receive HSTS header all-subtitles.com: could not connect to host all.tf: could not connect to host @@ -563,10 +618,9 @@ anfsanchezo.co: could not connect to host anfsanchezo.me: could not connect to host angeloroberto.ch: did not receive HSTS header anghami.com: did not receive HSTS header +anglesya.win: did not receive HSTS header anglictinatabor.cz: could not connect to host angryroute.com: could not connect to host -animal-nature-human.com: did not receive HSTS header -anime1.moe: could not connect to host anime1video.tk: could not connect to host animeday.ml: could not connect to host animesfusion.com.br: could not connect to host @@ -654,7 +708,7 @@ arcbit.io: could not connect to host ardao.me: could not connect to host ardorlabs.se: could not connect to host arewedubstepyet.com: could not connect to host -areyouever.me: could not connect to host +areyouever.me: did not receive HSTS header argennon.xyz: could not connect to host arguggi.co.uk: could not connect to host ariacreations.net: did not receive HSTS header @@ -669,7 +723,6 @@ armory.consulting: could not connect to host armory.supplies: could not connect to host armsday.com: could not connect to host armytricka.cz: did not receive HSTS header -arnaudb.net: did not receive HSTS header arod.tk: did not receive HSTS header aromaclub.nl: did not receive HSTS header aroundme.org: did not receive HSTS header @@ -712,7 +765,6 @@ ass.org.au: did not receive HSTS header assekuranzjobs.de: could not connect to host asset-alive.com: did not receive HSTS header asset-alive.net: did not receive HSTS header -astraalivankila.net: could not connect to host astrath.net: could not connect to host astrolpost.com: could not connect to host astromelody.com: did not receive HSTS header @@ -882,7 +934,6 @@ beachi.es: could not connect to host beaglewatch.com: could not connect to host beanjuice.me: could not connect to host beardydave.com: did not receive HSTS header -beasel.biz: could not connect to host beastlog.tk: could not connect to host beastowner.com: did not receive HSTS header beautyconcept.co: did not receive HSTS header @@ -920,8 +971,10 @@ bentphotos.se: could not connect to host benwattie.com: did not receive HSTS header benzkosmetik.de: did not receive HSTS header beourvictim.com: max-age too low: 2678400 +bep362.vn: did not receive HSTS header beraru.tk: could not connect to host berger.work: could not connect to host +bergland-seefeld.at: did not receive HSTS header berlatih.com: did not receive HSTS header berlinleaks.com: could not connect to host bernieware.de: could not connect to host @@ -961,6 +1014,7 @@ beyuna.nl: did not receive HSTS header bezorg.ninja: could not connect to host bezprawnik.pl: did not receive HSTS header bf.am: max-age too low: 0 +bfd.vodka: did not receive HSTS header bfear.com: could not connect to host bfelob.gov: max-age too low: 86400 bffm.biz: could not connect to host @@ -992,6 +1046,7 @@ billkiss.com: could not connect to host billninja.com: did not receive HSTS header billrusling.com: could not connect to host bimbo.com: did not receive HSTS header +binaryfigments.com: max-age too low: 86400 binderapp.net: could not connect to host bioespuna.eu: did not receive HSTS header biofam.ru: did not receive HSTS header @@ -1073,11 +1128,9 @@ bluserv.net: could not connect to host bluteklab.com: did not receive HSTS header blutroyal.de: could not connect to host bm-trading.nl: did not receive HSTS header -bmone.net: could not connect to host bnhlibrary.com: did not receive HSTS header board-buy.ru: could not connect to host boardgamegeeks.de: could not connect to host -bobep.ru: could not connect to host bobobox.net: could not connect to host bodo-wolff.de: could not connect to host bodyblog.nl: did not receive HSTS header @@ -1130,14 +1183,13 @@ brandnewdays.nl: could not connect to host brandon.so: could not connect to host brandred.net: could not connect to host brandspray.com: could not connect to host -brasilmorar.com: did not receive HSTS header +brasilmorar.com: could not connect to host bratteng.xyz: could not connect to host bravz.de: could not connect to host bregnedalsystems.dk: did not receive HSTS header bremensaki.com: max-age too low: 2592000 brenden.net.au: did not receive HSTS header brentnewbury.com: could not connect to host -brettabel.com: could not connect to host bretz-hufer.de: could not connect to host brfvh24.se: could not connect to host brickoo.com: could not connect to host @@ -1345,7 +1397,6 @@ catalin.pw: could not connect to host catarsisvr.com: could not connect to host catinmay.com: did not receive HSTS header catnapstudios.com: could not connect to host -cattivo.nl: could not connect to host cavaleria.ro: did not receive HSTS header caveclan.org: did not receive HSTS header cavedevs.de: could not connect to host @@ -1468,7 +1519,6 @@ ciicutini.ro: did not receive HSTS header cim2b.de: could not connect to host cimalando.eu: could not connect to host cinartelorgu.com: did not receive HSTS header -cinefilia.tk: did not receive HSTS header cintdirect.com: could not connect to host cioconference.co.nz: could not connect to host ciplanutrition.com: did not receive HSTS header @@ -1476,7 +1526,6 @@ cirrohost.com: did not receive HSTS header ciscohomeanalytics.com: could not connect to host ciscommerce.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 119" data: no] citiagent.cz: did not receive HSTS header -citymoobel.ee: did not receive HSTS header cityoflaurel.org: did not receive HSTS header ciuciucadou.ro: could not connect to host cium.ru: could not connect to host @@ -1544,8 +1593,8 @@ cncn.us: did not receive HSTS header cnwarn.com: could not connect to host co-driversphoto.se: could not connect to host co50.com: did not receive HSTS header +coach-sportif.paris: did not receive HSTS header cobrax.net: could not connect to host -cocaine.ninja: could not connect to host cocktailfuture.fr: could not connect to host cocolovesdaddy.com: could not connect to host codabix.com: did not receive HSTS header @@ -1569,7 +1618,7 @@ codercross.com: could not connect to host codes.pk: did not receive HSTS header codewiththepros.org: could not connect to host codymoniz.com: did not receive HSTS header -coerthas.com: could not connect to host +coerthas.com: max-age too low: 0 coffeeetc.co.uk: max-age too low: 7776000 coffeestrategies.com: max-age too low: 5184000 cogniflex.com: did not receive HSTS header @@ -1579,6 +1628,7 @@ coindam.com: could not connect to host coldhak.ca: could not connect to host coldlostsick.net: could not connect to host colearnr.com: could not connect to host +collabra.email: did not receive HSTS header collard.tk: did not receive HSTS header collegepulse.org: could not connect to host collies.eu: max-age too low: 3 @@ -1696,6 +1746,7 @@ create-test-publish.co.uk: could not connect to host creativephysics.ml: could not connect to host creativeplayuk.com: did not receive HSTS header crecket.me: could not connect to host +creditstar.lt: max-age too low: 0 crendontech.com: could not connect to host crestoncottage.com: could not connect to host crimewatch.net.za: could not connect to host @@ -1851,7 +1902,7 @@ dashburst.com: did not receive HSTS header dashnimorad.com: did not receive HSTS header data-abundance.com: could not connect to host data.haus: could not connect to host -dataformers.at: did not receive HSTS header +data.qld.gov.au: did not receive HSTS header datarank.com: max-age too low: 0 dataretention.solutions: could not connect to host datasnitch.co.uk: could not connect to host @@ -1898,7 +1949,6 @@ deco.me: could not connect to host decomplify.com: could not connect to host dedicatutiempo.es: could not connect to host deepcovelabs.net: could not connect to host -deepcreampie.com: did not receive HSTS header deepearth.uk: could not connect to host deeprecce.link: could not connect to host deeprecce.tech: could not connect to host @@ -1912,6 +1962,7 @@ deight.co: could not connect to host deinserverhost.de: did not receive HSTS header dekasan.ru: could not connect to host delayrefunds.co.uk: could not connect to host +delbrouck.ch: did not receive HSTS header deliverance.co.uk: could not connect to host deltaconcepts.de: did not receive HSTS header delvj.org: could not connect to host @@ -2004,7 +2055,6 @@ digitalriver.tk: could not connect to host digitalskillswap.com: could not connect to host dim.lighting: could not connect to host dinamoelektrik.com: could not connect to host -dingcc.com: did not receive HSTS header dingcc.me: could not connect to host dinkum.online: could not connect to host dipconsultants.com: could not connect to host @@ -2059,12 +2109,12 @@ doeswindowssuckforeveryoneorjustme.com: could not connect to host dogbox.se: did not receive HSTS header dogespeed.ga: could not connect to host doggieholic.net: could not connect to host +dognlife.com: did not receive HSTS header dogoodbehappyllc.com: could not connect to host dohosting.ru: could not connect to host dojin.nagoya: could not connect to host dokan.online: did not receive HSTS header doked.io: could not connect to host -dolcevitatech.education: did not receive HSTS header dolevik.com: could not connect to host dollarstore24.com: could not connect to host dollywiki.co.uk: could not connect to host @@ -2082,7 +2132,6 @@ donmez.uk: could not connect to host donmez.ws: could not connect to host donttrustrobots.nl: could not connect to host donzelot.co.uk: did not receive HSTS header -dooby.fr: did not receive HSTS header doobydude.us: could not connect to host doodledraw.ninja: did not receive HSTS header dooku.cz: could not connect to host @@ -2162,7 +2211,6 @@ dullsir.com: did not receive HSTS header dungi.org: could not connect to host duongpho.com: did not receive HSTS header duskopy.top: could not connect to host -dutchessuganda.com: did not receive HSTS header dutchrank.com: did not receive HSTS header duuu.ch: could not connect to host dycontrol.de: could not connect to host @@ -2191,7 +2239,7 @@ earga.sm: could not connect to host earlybirdsnacks.com: could not connect to host earthrise16.com: could not connect to host earthsystemprediction.gov: could not connect to host -easez.net: could not connect to host +easez.net: did not receive HSTS header easychiller.org: could not connect to host easyocm.hu: did not receive HSTS header easyplane.it: did not receive HSTS header @@ -2557,6 +2605,7 @@ fedo.moe: could not connect to host feedthebot.com: did not receive HSTS header feezmodo.com: did not receive HSTS header fefore.com: could not connect to host +fegans.org.uk: did not receive HSTS header feirlane.org: could not connect to host felisslovakia.sk: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 119" data: no] feliwyn.fr: did not receive HSTS header @@ -2576,7 +2625,7 @@ fettbrot.tk: did not receive HSTS header fexmen.com: could not connect to host ff-getzersdorf.at: did not receive HSTS header ffmradio.de: did not receive HSTS header -ffxiv.cc: could not connect to host +ffxiv.cc: max-age too low: 0 fics-twosigma.com: could not connect to host fideleslaici.com: did not receive HSTS header fiendishmasterplan.com: did not receive HSTS header @@ -2588,7 +2637,6 @@ fikt.space: could not connect to host filebox.moe: could not connect to host filemeal.com: did not receive HSTS header filey.co.uk: did not receive HSTS header -filme-online.eu.com: did not receive HSTS header filmesubtitrate2017.online: could not connect to host finalgear.com: did not receive HSTS header finalvpn.com: could not connect to host @@ -2601,6 +2649,7 @@ finfev.de: could not connect to host fingent.com: did not receive HSTS header finiteheap.com: did not receive HSTS header finpt.com: could not connect to host +fintechnics.com: did not receive HSTS header fiodental.com.br: did not receive HSTS header firebaseio-demo.com: could not connect to host firebaseio.com: could not connect to host (error ignored - included regardless) @@ -2768,7 +2817,6 @@ futurestarsusa.org: did not receive HSTS header futuretechnologi.es: could not connect to host futureyouhealth.com: did not receive HSTS header fuvpn.com: did not receive HSTS header -fuwafuwa.moe: could not connect to host fuxwerk.de: could not connect to host fwest.ovh: did not receive HSTS header fwest98.ovh: did not receive HSTS header @@ -2811,7 +2859,7 @@ gamechasm.com: could not connect to host gamefund.me: did not receive HSTS header gamehacks.me: could not connect to host gameink.net: max-age too low: 0 -gamek.es: did not receive HSTS header +gamek.es: could not connect to host gamenected.com: could not connect to host gamenected.de: could not connect to host gamepad.vg: could not connect to host @@ -2839,7 +2887,6 @@ garfieldairlines.net: did not receive HSTS header gatapro.net: could not connect to host gatorsa.es: did not receive HSTS header gaussorgues.me: could not connect to host -gbc-radio.nl: did not receive HSTS header gc.net: could not connect to host gdegem.org: did not receive HSTS header gebn.co.uk: did not receive HSTS header @@ -2850,7 +2897,6 @@ geeks.lgbt: did not receive HSTS header geeky.software: could not connect to host geemo.top: could not connect to host geeq.ch: could not connect to host -geh.li: did not receive HSTS header geli-graphics.com: did not receive HSTS header gemsoftheworld.org: could not connect to host genesischangelog.com: did not receive HSTS header @@ -2944,7 +2990,6 @@ globalinsights.xyz: could not connect to host globalittech.com: could not connect to host globalmusic.ga: could not connect to host globalsites.nl: did not receive HSTS header -globaltennis.ca: could not connect to host glotter.com: did not receive HSTS header gloucesterphotographer.com: did not receive HSTS header glubbforum.de: did not receive HSTS header @@ -3313,6 +3358,7 @@ hoikuen-now.top: could not connect to host holgerlehner.com: could not connect to host holifestival-freyung.de: could not connect to host holymoly.lu: could not connect to host +holytransaction.com: did not receive HSTS header homa.website: could not connect to host homads.com: did not receive HSTS header homeandyarddetailing.com: could not connect to host @@ -3390,7 +3436,7 @@ huodongweb.com: could not connect to host hup.blue: could not connect to host huskybutt.dog: could not connect to host hycken.com: did not receive HSTS header -hydaelyn.com: could not connect to host +hydaelyn.com: max-age too low: 0 hydra.ws: could not connect to host hydrodipcenter.nl: did not receive HSTS header hydronium.cf: could not connect to host @@ -3442,6 +3488,7 @@ idecode.net: could not connect to host idedr.com: could not connect to host identitylabs.uk: could not connect to host idgsupply.com: did not receive HSTS header +idinby.dk: did not receive HSTS header idisplay.es: did not receive HSTS header idlekernel.com: could not connect to host idontexist.me: did not receive HSTS header @@ -3478,7 +3525,6 @@ ilmconpm.de: did not receive HSTS header ilona.graphics: did not receive HSTS header iluvscotland.co.uk: max-age too low: 7776000 imakepoems.net: could not connect to host -imanageproducts.uk: could not connect to host imanolbarba.net: could not connect to host ime.moe: could not connect to host imim.pw: could not connect to host @@ -3552,7 +3598,6 @@ injust.gq: could not connect to host injust.me: could not connect to host injust.ml: could not connect to host injust.tk: could not connect to host -inkable.com.au: did not receive HSTS header inked-guy.de: could not connect to host inkedguy.de: could not connect to host inkstory.gr: did not receive HSTS header @@ -3651,7 +3696,6 @@ ishangirdhar.com: could not connect to host ishillaryclintoninprisonyet.com: could not connect to host isitamor.pm: could not connect to host iskaz.rs: did not receive HSTS header -islandinthenet.com: did not receive HSTS header ismetroonfiretoday.com: could not connect to host isogen5.com: could not connect to host isogram.nl: could not connect to host @@ -3681,6 +3725,7 @@ itshost.ru: could not connect to host itu2015.de: could not connect to host ius.io: did not receive HSTS header iuscommunity.org: could not connect to host +ivi-co.com: max-age too low: 0 ivi-fertility.com: max-age too low: 0 ivi.es: max-age too low: 0 ivk.website: could not connect to host @@ -3706,7 +3751,6 @@ jacobdevans.com: could not connect to host jacobparry.ca: did not receive HSTS header jagido.de: did not receive HSTS header jahliveradio.com: could not connect to host -jaion.ml: did not receive HSTS header jaksi.io: could not connect to host jamanji.com.ng: could not connect to host james.je: could not connect to host @@ -3759,6 +3803,7 @@ jaylen.com.ar: did not receive HSTS header jayschulman.com: did not receive HSTS header jayscoaching.com: did not receive HSTS header jayshao.com: did not receive HSTS header +jayxon.com: did not receive HSTS header jbfp.dk: could not connect to host jbn.mx: could not connect to host jcch.de: could not connect to host @@ -3800,7 +3845,7 @@ jiangzm.com: could not connect to host jichi.me: could not connect to host jikken.de: could not connect to host jimas.eu: did not receive HSTS header -jimenacocina.com: could not connect to host +jimenacocina.com: did not receive HSTS header jimgao.tk: did not receive HSTS header jimmehcai.com: could not connect to host jimmycai.org: could not connect to host @@ -3814,10 +3859,10 @@ jkb.pics: could not connect to host jkbuster.com: could not connect to host jkng.eu: did not receive HSTS header jko.works: could not connect to host +jm06.com: did not receive HSTS header jm22.com: could not connect to host jmdekker.it: could not connect to host joakimalgroy.com: could not connect to host -job-offer.de: did not receive HSTS header jobflyapp.com: could not connect to host jobshq.com: did not receive HSTS header jobss.co.uk: did not receive HSTS header @@ -3901,7 +3946,6 @@ k1cp.com: could not connect to host ka-clan.com: could not connect to host kabinapp.com: could not connect to host kabuabc.com: could not connect to host -kabus.org: could not connect to host kackscharf.de: could not connect to host kadioglumakina.com.tr: did not receive HSTS header kaela.design: could not connect to host @@ -3987,9 +4031,10 @@ kindof.ninja: could not connect to host kingmanhall.org: could not connect to host kinkdr.com: could not connect to host kinnon.enterprises: could not connect to host +kintoandar.com: max-age too low: 0 kintrip.com: did not receive HSTS header kionetworks.com: did not receive HSTS header -kipin.fr: could not connect to host +kipin.fr: did not receive HSTS header kipira.com: could not connect to host kirara.eu: could not connect to host kircp.com: could not connect to host @@ -4013,6 +4058,7 @@ kitsta.com: could not connect to host kiwiirc.com: max-age too low: 5256000 kiyo.space: could not connect to host kizil.net: could not connect to host +kj1397.com: did not receive HSTS header kjaermaxi.me: did not receive HSTS header kjg-bachrain.de: could not connect to host klauwd.com: did not receive HSTS header @@ -4147,7 +4193,8 @@ lampl.info: could not connect to host lana.swedbank.se: did not receive HSTS header lanauzedesigns.com: did not receive HSTS header lanboll.com: could not connect to host -lancehoteis.com.br: could not connect to host +lancehoteis.com: did not receive HSTS header +lancehoteis.com.br: did not receive HSTS header land-links.org: did not receive HSTS header landgoedverkopen.nl: could not connect to host landhuisverkopen.nl: could not connect to host @@ -4157,7 +4204,6 @@ langenbach.rocks: could not connect to host langendries.eu: could not connect to host langhun.me: did not receive HSTS header lanzainc.xyz: could not connect to host -lanzarote-online.info: could not connect to host laobox.fr: could not connect to host laplaceduvillage.net: could not connect to host laquack.com: could not connect to host @@ -4183,6 +4229,7 @@ laxatus.com: could not connect to host laxiongames.es: could not connect to host layer8.tk: could not connect to host lbrt.xyz: could not connect to host +lcht.ch: did not receive HSTS header ldarby.me.uk: could not connect to host leadbook.ru: max-age too low: 604800 leadership9.com: could not connect to host @@ -4248,7 +4295,7 @@ li.search.yahoo.com: did not receive HSTS header liaillustr.at: did not receive HSTS header liam-w.com: did not receive HSTS header liamjack.fr: could not connect to host -lianye.in: could not connect to host +lianye.in: did not receive HSTS header lianyexiuchang.in: could not connect to host liaoshuma.com: could not connect to host libanco.com: could not connect to host @@ -4343,6 +4390,7 @@ loginseite.com: could not connect to host logistify.com.mx: did not receive HSTS header lognot.net: could not connect to host logymedia.com: could not connect to host +loisircreatif.net: did not receive HSTS header lojadocristaozinho.com.br: could not connect to host lojasviavento.com.br: could not connect to host loli.bz: did not receive HSTS header @@ -4458,7 +4506,6 @@ mafiaforum.de: did not receive HSTS header mafiareturns.com: max-age too low: 2592000 magenx.com: did not receive HSTS header magia360.com: did not receive HSTS header -magicbroccoli.de: did not receive HSTS header mahamed91.pw: could not connect to host mahfouzadedimeji.com: did not receive HSTS header mail-settings.google.com: did not receive HSTS header (error ignored - included regardless) @@ -4535,6 +4582,7 @@ markcp.me: could not connect to host market.android.com: did not receive HSTS header (error ignored - included regardless) marketespace.fr: did not receive HSTS header markorszulak.com: did not receive HSTS header +markrobin.de: did not receive HSTS header marksill.com: could not connect to host marktboten.de: did not receive HSTS header marktissink.nl: did not receive HSTS header @@ -4588,7 +4636,6 @@ matthewprenger.com: could not connect to host matthiassteen.be: max-age too low: 0 mattressinsider.com: max-age too low: 3153600 mattsvensson.com: max-age too low: 0 -mattwservices.co.uk: did not receive HSTS header matty.digital: did not receive HSTS header maultrom.ml: could not connect to host maupiknik.com: did not receive HSTS header @@ -4614,6 +4661,7 @@ mclist.it: could not connect to host mclyr.com: max-age too low: 7776000 mcooperlaw.com: did not receive HSTS header mdfnet.se: did not receive HSTS header +mdkr.nl: did not receive HSTS header mdscomp.net: did not receive HSTS header meadowfen.farm: could not connect to host meadowfenfarm.com: could not connect to host @@ -4692,7 +4740,6 @@ mfedderke.com: could not connect to host mfxbe.de: did not receive HSTS header mgdigital.fr: did not receive HSTS header mgiay.com: did not receive HSTS header -mgknet.com: could not connect to host mh-bloemen.co.jp: could not connect to host mhdsyarif.com: did not receive HSTS header mhealthdemocamp.com: could not connect to host @@ -4737,7 +4784,6 @@ mikadesign.se: did not receive HSTS header mikaelemilsson.net: did not receive HSTS header mikeburns.com: could not connect to host mikeg.de: did not receive HSTS header -mikek.work: could not connect to host mikeology.org: could not connect to host mikepair.net: did not receive HSTS header mikeybot.com: could not connect to host @@ -4771,10 +4817,10 @@ minecraftforums.ml: could not connect to host minecraftserverz.com: could not connect to host minecraftvoter.com: could not connect to host mineover.es: could not connect to host +minesouls.fr: did not receive HSTS header mingyueli.com: could not connect to host minh.at: could not connect to host mini-piraten.de: did not receive HSTS header -mini2.fi: did not receive HSTS header minikneet.nl: could not connect to host minimoo.se: could not connect to host minimvc.com: did not receive HSTS header @@ -4843,7 +4889,7 @@ moelord.org: could not connect to host moen.io: did not receive HSTS header mogry.net: could not connect to host moho.kr: could not connect to host -mohs.es: did not receive HSTS header +mohs.es: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 119" data: no] moitur.com: could not connect to host mokhtarmial.com: did not receive HSTS header mols.me: could not connect to host @@ -4930,7 +4976,6 @@ mtdn.jp: could not connect to host mtg-esport.de: did not receive HSTS header mu.search.yahoo.com: did not receive HSTS header muahahahaha.co.uk: could not connect to host -muchohentai.com: did not receive HSTS header mudcrab.us: did not receive HSTS header mujadin.se: did not receive HSTS header mundodapoesia.com: did not receive HSTS header @@ -4960,7 +5005,7 @@ muzykaprzeszladoplay.pl: did not receive HSTS header mvanmarketing.nl: did not receive HSTS header mvsecurity.nl: could not connect to host mw.search.yahoo.com: did not receive HSTS header -mwohlfarth.de: could not connect to host +mwohlfarth.de: did not receive HSTS header my-owncloud.com: could not connect to host my-pawnshop.com.ua: could not connect to host my-voice.nl: did not receive HSTS header @@ -5080,7 +5125,7 @@ nemovement.org: could not connect to host neoani.me: could not connect to host neofelhz.space: could not connect to host neonisi.com: could not connect to host -neonnuke.tech: could not connect to host +neonnuke.tech: did not receive HSTS header neosolution.ca: did not receive HSTS header nepustil.net: did not receive HSTS header nerd42.de: could not connect to host @@ -5157,7 +5202,6 @@ niho.jp: did not receive HSTS header nikcub.com: could not connect to host niklas.pw: did not receive HSTS header niklaslindblad.se: did not receive HSTS header -nikolasbradshaw.com: did not receive HSTS header ninchisho-online.com: did not receive HSTS header ninhs.org: could not connect to host ninjaspiders.com: did not receive HSTS header @@ -5295,7 +5339,6 @@ offshore-unternehmen.com: could not connect to host offshorefirma-gruenden.com: could not connect to host offshoremarineparts.com: did not receive HSTS header oganek.ie: could not connect to host -ogkw.de: did not receive HSTS header ogogoshop.com: could not connect to host ohai.su: could not connect to host ohling.org: could not connect to host @@ -5432,8 +5475,8 @@ osticketawesome.com: did not receive HSTS header oswaldmattgroup.com: did not receive HSTS header otakuworld.de: could not connect to host othercode.nl: could not connect to host -othermedia.cc: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 119" data: no] -otherstuff.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 119" data: no] +othermedia.cc: could not connect to host +otherstuff.nl: could not connect to host otichi.com: did not receive HSTS header otrsdemo.hu: did not receive HSTS header ottospora.nl: could not connect to host @@ -5485,6 +5528,8 @@ panaceallc.net: could not connect to host panama-gbs.com: did not receive HSTS header panamaequity.com: did not receive HSTS header panamateakforestry.com: did not receive HSTS header +panascais.io: did not receive HSTS header +panascais.net: did not receive HSTS header panni.me: could not connect to host panoranordic.net: could not connect to host pansu.space: could not connect to host @@ -5534,7 +5579,6 @@ patt.us: could not connect to host patterson.mp: could not connect to host paul-kerebel.pro: could not connect to host paulbunyanmls.com: did not receive HSTS header -paulchen.at: could not connect to host paulproell.at: could not connect to host paulyang.cn: did not receive HSTS header pavelfojt.cz: did not receive HSTS header @@ -5584,7 +5628,7 @@ performaterm.ro: could not connect to host performous.org: could not connect to host perfumista.vn: did not receive HSTS header periscopeliveweb.com: could not connect to host -perlwork.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 119" data: no] +perlwork.nl: could not connect to host pernatie.ru: could not connect to host perplex.nl: did not receive HSTS header perroud.pro: did not receive HSTS header @@ -5673,7 +5717,7 @@ pixel.google.com: did not receive HSTS header (error ignored - included regardle pixelcode.com.au: could not connect to host pixelhero.co.uk: did not receive HSTS header pixi.chat: could not connect to host -pixi.me: could not connect to host +pixi.me: did not receive HSTS header pizzadoc.ch: could not connect to host pjbet.mg: did not receive HSTS header pk.search.yahoo.com: did not receive HSTS header @@ -5693,7 +5737,6 @@ playerhunter.com: did not receive HSTS header playflick.com: did not receive HSTS header playmaker.io: could not connect to host playnation.io: could not connect to host -playsharp.com: could not connect to host pleasure.forsale: could not connect to host pleier-it.de: did not receive HSTS header pleier.it: did not receive HSTS header @@ -5813,9 +5856,7 @@ pro-zone.com: could not connect to host procode.gq: could not connect to host prodpad.com: did not receive HSTS header production.vn: did not receive HSTS header -productived.net: did not receive HSTS header producto8.com: did not receive HSTS header -productpeo.pl: could not connect to host profhome-shop.com: did not receive HSTS header profi-durchgangsmelder.de: did not receive HSTS header profivps.com: could not connect to host @@ -5869,6 +5910,7 @@ psylab.re: could not connect to host ptn.moscow: could not connect to host ptonet.com: could not connect to host pubkey.is: could not connect to host +publications.qld.gov.au: did not receive HSTS header publicidadnovagrass.com.mx: did not receive HSTS header publicspeakingcamps.com: could not connect to host puentes.info: could not connect to host @@ -5947,6 +5989,7 @@ qwaser.fr: could not connect to host qwilink.me: could not connect to host r-core.ru: could not connect to host r-rickroll-u.pw: could not connect to host +r0uzic.net: did not receive HSTS header r10n.com: did not receive HSTS header r15.me: did not receive HSTS header r3bl.me: did not receive HSTS header @@ -6047,10 +6090,11 @@ regalpalms.com: did not receive HSTS header regenbogenwald.de: did not receive HSTS header regenerescence.com: did not receive HSTS header reggae-cdmx.com: could not connect to host +registertovoteflorida.gov: did not receive HSTS header rehabthailand.nl: could not connect to host reic.me: could not connect to host reikiqueen.uk: could not connect to host -reisyukaku.org: could not connect to host +reisyukaku.org: did not receive HSTS header reithguard-it.de: did not receive HSTS header rejo.in: could not connect to host rejuvemedspa.com: did not receive HSTS header @@ -6163,7 +6207,7 @@ rocksberg.net: could not connect to host rockz.io: did not receive HSTS header rodney.id.au: did not receive HSTS header rodneybrooksjr.com: did not receive HSTS header -rodosto.com: could not connect to host +rodosto.com: did not receive HSTS header roeper.party: could not connect to host roesemann.email: could not connect to host roguelikecenter.fr: did not receive HSTS header @@ -6186,6 +6230,7 @@ rootwpn.com: could not connect to host rop.io: could not connect to host rossen.be: did not receive HSTS header rosslug.org.uk: could not connect to host +rotter-dam.nl: did not receive HSTS header rough.nu: could not connect to host roundtheme.com: did not receive HSTS header rous.se: could not connect to host @@ -6243,7 +6288,7 @@ s-d-v.ch: could not connect to host s-rickroll-p.pw: could not connect to host s.how: could not connect to host saabwa.org: could not connect to host -safegroup.pl: could not connect to host +safegroup.pl: did not receive HSTS header safelist.eu: did not receive HSTS header safematix.com: could not connect to host safemovescheme.co.uk: did not receive HSTS header @@ -6311,13 +6356,13 @@ sawamura-rental.com: did not receive HSTS header say-hanabi.com: could not connect to host sayhanabi.com: could not connect to host sazima.ru: did not receive HSTS header +sbobetfun.com: did not receive HSTS header sbox-archives.com: could not connect to host sby.de: did not receive HSTS header sc4le.com: could not connect to host scannabi.com: could not connect to host schadegarant.net: could not connect to host schauer.so: could not connect to host -schawe.me: could not connect to host schermreparatierotterdam.nl: did not receive HSTS header schmitt.ovh: could not connect to host schnell-abnehmen.tips: did not receive HSTS header @@ -6357,7 +6402,7 @@ scribbleserver.com: could not connect to host scribe.systems: could not connect to host scrion.com: could not connect to host script.google.com: did not receive HSTS header (error ignored - included regardless) -scriptenforcer.net: could not connect to host +scriptenforcer.net: did not receive HSTS header scriptict.nl: could not connect to host scrollstory.com: did not receive HSTS header sdhmanagementgroup.com: could not connect to host @@ -6383,7 +6428,6 @@ secondarysurvivorportal.help: could not connect to host secondbyte.nl: could not connect to host secondpay.nl: could not connect to host secondspace.ca: could not connect to host -secretpanties.com: could not connect to host section508.gov: did not receive HSTS header sectun.com: did not receive HSTS header secumail.nl: did not receive HSTS header @@ -6446,7 +6490,6 @@ seobot.com.au: could not connect to host seomobo.com: could not connect to host seosanantonioinc.com: did not receive HSTS header seowarp.net: did not receive HSTS header -sepalandseed.com: did not receive HSTS header seq.tf: did not receive HSTS header serathius.ovh: could not connect to host serenitycreams.com: did not receive HSTS header @@ -6626,7 +6669,6 @@ slix.io: could not connect to host slope.haus: could not connect to host slotboss.co.uk: did not receive HSTS header slovakiana.sk: did not receive HSTS header -slvh.fr: could not connect to host slycurity.de: did not receive HSTS header smablo.com: did not receive HSTS header smallcdn.rocks: could not connect to host @@ -6641,7 +6683,6 @@ smarthomedna.com: did not receive HSTS header smartofficesandsmarthomes.com: did not receive HSTS header smartphone.continental.com: could not connect to host smartrak.co.nz: did not receive HSTS header -smartshoppers.es: did not receive HSTS header smdev.fr: could not connect to host smet.us: could not connect to host smexpt.com: did not receive HSTS header @@ -6773,7 +6814,6 @@ sprutech.de: did not receive HSTS header spyroszarzonis.com: did not receive HSTS header square.gs: could not connect to host squatldf.org: did not receive HSTS header -sqzryang.com: did not receive HSTS header srcc.fr: could not connect to host srevilak.net: did not receive HSTS header srmaximo.com: could not connect to host @@ -6839,6 +6879,7 @@ stevensononthe.net: did not receive HSTS header stewartremodelingadvantage.com: could not connect to host stforex.com: did not receive HSTS header stfw.info: could not connect to host +stickies.io: did not receive HSTS header sticklerjs.org: could not connect to host stigroom.com: could not connect to host stillblackhat.id: could not connect to host @@ -6914,10 +6955,9 @@ sumoatm.com: did not receive HSTS header sumoscout.de: could not connect to host suncountrymarine.com: did not receive HSTS header sundanceusa.com: did not receive HSTS header -sunfulong.me: could not connect to host +sunflyer.cn: did not receive HSTS header sunlandsg.vn: did not receive HSTS header sunnyfruit.ru: could not connect to host -sunsetwx.com: did not receive HSTS header sunshinepress.org: could not connect to host sunyanzi.tk: could not connect to host suos.io: could not connect to host @@ -6962,6 +7002,7 @@ swfloshatraining.com: could not connect to host swimming.ca: did not receive HSTS header swisstranslate.ch: did not receive HSTS header swisstranslate.fr: did not receive HSTS header +swite.com: did not receive HSTS header swmd5c.org: could not connect to host swu.party: could not connect to host sxbk.pw: could not connect to host @@ -7204,7 +7245,6 @@ thepcweb.tk: could not connect to host thepiratebay.al: could not connect to host thepiratebay.poker: could not connect to host thepiratebay.tech: could not connect to host -theprivacysolution.com: did not receive HSTS header therewill.be: could not connect to host thesecurityteam.net: could not connect to host thesplit.is: could not connect to host @@ -7302,7 +7342,6 @@ tjc.host: did not receive HSTS header tjc.wiki: could not connect to host tjullrich.de: could not connect to host tkappertjedemetamorfose.nl: could not connect to host -tkarstens.de: did not receive HSTS header tkonstantopoulos.tk: could not connect to host tlcdn.net: could not connect to host tlo.hosting: could not connect to host @@ -7654,6 +7693,7 @@ vaalmarketplace.co.za: did not receive HSTS header vacationality.com: could not connect to host vackerbetong.se: could not connect to host vaddder.com: could not connect to host +vadodesign.nl: did not receive HSTS header valenscaelum.com: could not connect to host valentin-sundermann.de: could not connect to host valethound.com: could not connect to host @@ -7767,7 +7807,7 @@ vitagenda.nl: could not connect to host vitalita.cz: did not receive HSTS header vitalorange.com: max-age too low: 7776000 vitta.me: did not receive HSTS header -viva-french.com: could not connect to host +viva-french.com: did not receive HSTS header vivocloud.com: could not connect to host vizeat.com: did not receive HSTS header vizional.com: max-age too low: 0 @@ -7776,7 +7816,6 @@ vlastimilburian.cz: did not receive HSTS header vlora.city: could not connect to host vlvvl.com: did not receive HSTS header vm0.eu: did not receive HSTS header -vmgirls.com: could not connect to host vmrdev.com: could not connect to host voceinveste.com: did not receive HSTS header vogler.name: did not receive HSTS header @@ -7848,7 +7887,6 @@ wangqiliang.cn: did not receive HSTS header wangqiliang.org: did not receive HSTS header wangqiliang.xn--fiqs8s: could not connect to host wangzuan168.cc: could not connect to host -wanybug.cn: could not connect to host wapjt.cn: could not connect to host wapt.fr: did not receive HSTS header warandpeace.xyz: could not connect to host @@ -7865,10 +7903,10 @@ waterpoint.com.br: did not receive HSTS header watersb.org: could not connect to host watersportmarkt.net: did not receive HSTS header watsonhall.uk: could not connect to host +wattechweb.com: did not receive HSTS header wave.is: could not connect to host wavefloatrooms.com: did not receive HSTS header wavefrontsystemstech.com: could not connect to host -waytt.cf: did not receive HSTS header we-bb.com: could not connect to host wear2work.nl: did not receive HSTS header weaverhairextensions.nl: could not connect to host @@ -7970,6 +8008,7 @@ wikiclash.info: could not connect to host wikipeter.nl: did not receive HSTS header wikisports.eu: could not connect to host wildbee.org: could not connect to host +wilddog.com: did not receive HSTS header wilf1rst.com: could not connect to host wilfrid-calixte.fr: could not connect to host willcipriano.com: could not connect to host @@ -8074,7 +8113,6 @@ www-88599.com: did not receive HSTS header www-9995.com: did not receive HSTS header www-djbet.com: did not receive HSTS header www-jinshavip.com: could not connect to host -www.amazon.cn: did not receive HSTS header www.braintreepayments.com: did not receive HSTS header www.cueup.com: could not connect to host www.cyveillance.com: did not receive HSTS header @@ -8129,7 +8167,6 @@ xiaolvmu.com: could not connect to host xiaolvmu.me: could not connect to host xiaoxiao.im: could not connect to host xiazhanjian.com: could not connect to host -xiliant.com: could not connect to host ximens.me: could not connect to host xinbiji.cn: did not receive HSTS header xisa.it: could not connect to host @@ -8264,20 +8301,17 @@ yourbapp.ch: could not connect to host yourcomputer.expert: did not receive HSTS header yoursecondphone.co: could not connect to host yourstrongbox.com: could not connect to host +youss.cc: did not receive HSTS header ypiresia.fr: could not connect to host -ys-shop.biz: did not receive HSTS header ytcuber.xyz: could not connect to host ytvwld.de: did not receive HSTS header yu7.jp: did not receive HSTS header -yuan.ga: did not receive HSTS header yugege.cf: could not connect to host yuhen.ru: did not receive HSTS header yukiminami.net: could not connect to host yuko.moe: could not connect to host yukonrefugees.com: could not connect to host yummyfamilyrecipes.com: could not connect to host -yuna.love: could not connect to host -yuna.tg: could not connect to host yunpan.blue: did not receive HSTS header yuntama.xyz: did not receive HSTS header yunzhan.io: could not connect to host @@ -8335,13 +8369,14 @@ zeytin.pro: could not connect to host zh.search.yahoo.com: did not receive HSTS header zh1.li: could not connect to host zhang.wtf: could not connect to host +zhangge.net: did not receive HSTS header zhangruilin.com: did not receive HSTS header zhaojin97.cn: did not receive HSTS header zhendingresources.com: did not receive HSTS header zhh.in: could not connect to host zhihua-lai.com: did not receive HSTS header zhiin.net: could not connect to host -zhiku8.com: did not receive HSTS header +zhiku8.com: could not connect to host zhuji.com.cn: could not connect to host zi0r.com: did not receive HSTS header zian.online: could not connect to host @@ -8368,6 +8403,7 @@ zocken.com: did not receive HSTS header zockenbiszumumfallen.de: did not receive HSTS header zoe.vc: could not connect to host zohar.link: could not connect to host +zolotoy-standart.com.ua: did not receive HSTS header zomiac.pp.ua: could not connect to host zone-produkte.de: did not receive HSTS header zoneminder.com: did not receive HSTS header @@ -8379,7 +8415,6 @@ zoomingin.net: max-age too low: 5184000 zoommailing.com: did not receive HSTS header zorasvobodova.cz: did not receive HSTS header zortium.report: could not connect to host -zorz.info: could not connect to host zoznamrealit.sk: did not receive HSTS header zqhong.com: could not connect to host zqjs.tk: could not connect to host @@ -8389,9 +8424,9 @@ zubel.it: did not receive HSTS header zuram.net: could not connect to host zvncloud.com: did not receive HSTS header zwollemagazine.nl: did not receive HSTS header +zybbo.com: did not receive HSTS header zyf.pw: could not connect to host zymbit.com: did not receive HSTS header zync.ca: did not receive HSTS header zypgr.com: did not receive HSTS header zyso.org: could not connect to host -zyzardx.com: could not connect to host diff --git a/security/manager/ssl/nsSTSPreloadList.inc b/security/manager/ssl/nsSTSPreloadList.inc index afa94dfc35c3..97d0584170f2 100644 --- a/security/manager/ssl/nsSTSPreloadList.inc +++ b/security/manager/ssl/nsSTSPreloadList.inc @@ -8,7 +8,7 @@ /*****************************************************************************/ #include -const PRTime gPreloadListExpirationTime = INT64_C(1517420106404000); +const PRTime gPreloadListExpirationTime = INT64_C(1517592632694000); %% 0-1.party, 1 0.me.uk, 1 @@ -34,7 +34,6 @@ const PRTime gPreloadListExpirationTime = INT64_C(1517420106404000); 040fitvitality.nl, 1 046569.com, 1 04sun.com, 1 -050508.com, 1 050media.nl, 1 0513c.com, 1 0573wk.com, 1 @@ -44,7 +43,6 @@ const PRTime gPreloadListExpirationTime = INT64_C(1517420106404000); 0c3.de, 1 0cdn.ga, 1 0day.agency, 1 -0day.su, 1 0fl.com, 1 0i0.nl, 1 0ik.de, 1 @@ -116,7 +114,6 @@ const PRTime gPreloadListExpirationTime = INT64_C(1517420106404000); 132kv.ch, 1 13318522.com, 1 1359826938.rsc.cdn77.org, 1 -1391kj.com, 1 1395kj.com, 1 1396.cc, 1 1453914078.rsc.cdn77.org, 1 @@ -186,7 +183,6 @@ const PRTime gPreloadListExpirationTime = INT64_C(1517420106404000); 247a.co.uk, 1 247healthshop.com, 1 247medplan.com, 1 -247quickbooks.com, 1 2488.ch, 1 24hrs.shopping, 1 24ip.com, 1 @@ -230,7 +226,6 @@ const PRTime gPreloadListExpirationTime = INT64_C(1517420106404000); 2ulcceria.nl, 1 300mbmovie24.com, 1 3133780x.com, 1 -314166.com, 1 314chan.org, 1 31klabs.com, 1 31tv.ru, 1 @@ -329,8 +324,7 @@ const PRTime gPreloadListExpirationTime = INT64_C(1517420106404000); 500p.xyz, 1 50plusnet.nl, 1 513vpn.net, 1 -517vpn.cn, 1 -518maicai.com, 0 +518maicai.com, 1 525.info, 1 52neptune.com, 1 5432.cc, 1 @@ -593,7 +587,7 @@ aciksite.com, 1 acksoft.fr, 1 acksoftdemo.fr, 1 aclu.org, 0 -acluva.org, 1 +acluva.org, 0 acme.beer, 1 acmexyz123.info, 1 acnpacific.com, 1 @@ -609,7 +603,6 @@ acsc.gov.au, 1 acsemb.org, 1 acsihostingsolutions.com, 1 acsports.ca, 1 -actgruppe.de, 1 actilove.ch, 1 actionmadagascar.ch, 1 actionsack.com, 1 @@ -856,6 +849,7 @@ agrekov.ru, 1 agreor.com, 1 agrias.com.br, 1 agridir.site, 1 +agroglass.com.br, 1 agroline.by, 1 agroyard.com.ua, 1 agsb.ch, 1 @@ -1384,7 +1378,6 @@ angelinahair.com, 1 angeloventuri.com, 1 anginf.de, 1 anglertanke.de, 1 -anglesya.win, 1 anglictina-sojcak.cz, 1 anglictinasojcak.cz, 1 angrapa.ru, 1 @@ -1396,12 +1389,14 @@ angusmak.com, 1 animacurse.moe, 1 animaemundi.be, 1 animal-liberation.com, 1 +animal-nature-human.com, 1 animal-rights.com, 1 animalnet.de, 0 animalstropic.com, 1 animationsmusicales.ch, 1 anime.my, 0 anime1.me, 1 +anime1.moe, 1 anime1.top, 1 animeai.com, 1 animefluxxx.com, 1 @@ -1745,6 +1740,7 @@ armstrongsengineering.com, 1 army24.cz, 1 armyofbane.com, 1 armyprodej.cz, 1 +arnaudb.net, 1 arnaudfeld.de, 1 arnaudminable.net, 1 arne-petersen.net, 1 @@ -1899,6 +1895,7 @@ astec-informatica.com, 1 astengox.com, 1 astenretail.com, 1 asthon.cn, 1 +astraalivankila.net, 1 astral.gq, 1 astrea-voetbal-groningen.nl, 1 astronomie-fulda.de, 1 @@ -2486,6 +2483,7 @@ bearcosports.com.br, 1 bearded.sexy, 1 bearden.io, 1 bearingworks.com, 1 +beasel.biz, 1 beastowner.li, 1 beatnikbreaks.com, 1 beaute-eternelle.ch, 1 @@ -2633,7 +2631,6 @@ bentley.link, 1 bentrask.com, 1 benzou-space.com, 1 beoordelingen.be, 1 -bep362.vn, 1 beranovi.com, 1 berasavocate.com, 1 beraten-entwickeln-steuern.de, 1 @@ -2641,7 +2638,6 @@ berdu.id, 1 berduri.com, 1 bergenhave.nl, 1 bergevoet-fa.nl, 1 -bergland-seefeld.at, 1 bergstoneware.com, 1 berlin-flirt.de, 1 berlin-kohlefrei.de, 1 @@ -2752,7 +2748,6 @@ beyours.be, 1 bezoomnyville.com, 1 bezpecnostsiti.cf, 1 bfam.tv, 1 -bfd.vodka, 1 bfi.wien, 0 bfrailwayclub.cf, 1 bftbradio.com, 1 @@ -2862,7 +2857,6 @@ binaryabstraction.com, 1 binaryapparatus.com, 1 binaryappdev.com, 1 binaryevolved.com, 1 -binaryfigments.com, 1 binarystud.io, 1 binding-problem.com, 1 binfind.com, 1 @@ -3184,6 +3178,7 @@ bm-i.ch, 1 bm-immo.ch, 1 bmet.de, 1 bmoattachments.org, 1 +bmone.net, 1 bmros.com.ar, 1 bn1digital.co.uk, 1 bnb-buddy.nl, 1 @@ -3194,6 +3189,7 @@ boatme.de, 1 bobancoamigo.com, 1 bobazar.com, 1 bobcopeland.com, 1 +bobep.ru, 1 bobiji.com, 0 bobisec.cz, 1 bobkoetsier.nl, 1 @@ -3469,6 +3465,7 @@ brentacampbell.com, 1 bress.cloud, 1 bressier.fr, 1 bretcarmichael.com, 1 +brettabel.com, 1 brettcornwall.com, 1 brettelliff.com, 1 bretzner.fr, 1 @@ -3672,7 +3669,7 @@ burke.services, 1 burlapsac.ca, 1 burlesquemakeup.com, 1 burnerfitness.com, 1 -burningflipside.com, 1 +burningflipside.com, 0 burntfish.com, 1 burnworks.com, 1 buronwater.com, 1 @@ -4091,6 +4088,7 @@ catmoose.ca, 1 catnet.dk, 0 catnmeow.com, 1 catsmagic.pp.ua, 1 +cattivo.nl, 0 caughtredhanded.co.nz, 1 caulfieldeastapartments.com.au, 1 caulfieldracecourseapartments.com.au, 1 @@ -4590,6 +4588,7 @@ cimballa.com, 1 cimfax.com, 1 cinafilm.com, 1 cine-music.de, 1 +cinefilia.tk, 1 cinefilzonen.se, 1 cinema5.ru, 1 cinemaclub.co, 1 @@ -4637,6 +4636,7 @@ cittadesign.com, 0 citya.com, 1 citybusexpress.com, 1 citylights.eu, 1 +citymoobel.ee, 1 cityoftitans.com, 1 cityoftitansmmo.com, 1 citysportapp.com, 1 @@ -4831,7 +4831,6 @@ cnwage.com, 1 co-factor.ro, 1 co-yutaka.com, 1 co.search.yahoo.com, 0 -coach-sportif.paris, 1 coachezmoi.ch, 1 coaching-impulse.ch, 1 coachingconsultancy.com, 1 @@ -4844,6 +4843,7 @@ cobalt.io, 1 cobaltgp.com, 1 cobaltlp.com, 1 cocaine-import.agency, 1 +cocaine.ninja, 1 cocalc.com, 1 coccinellaskitchen.com, 1 coccinellaskitchen.de, 1 @@ -4973,7 +4973,6 @@ collaboracloudsuite.com, 1 collaboraoffice.co.uk, 1 collaboraoffice.com, 1 collabornation.net, 1 -collabra.email, 1 collaction.hk, 1 collada.org, 1 collbox.co, 1 @@ -5399,7 +5398,6 @@ creditkarma.com, 1 creditos-rapidos.com, 1 creditproautos.com, 0 creditstar.es, 1 -creditstar.lt, 1 creeks-coworking.com, 1 creep.im, 1 creepycraft.nl, 1 @@ -5892,7 +5890,6 @@ dashboard.run, 1 dashboard.yt, 1 dashnearby.com, 1 data.gov, 1 -data.qld.gov.au, 0 data.world, 1 databeam.de, 1 databionix.com, 1 @@ -5906,6 +5903,7 @@ datacentrenews.eu, 1 datacubed.com, 1 datadit.hu, 1 datadyne.technology, 1 +dataformers.at, 1 datahove.no, 0 dataisme.com, 1 datajapan.co.jp, 1 @@ -6105,6 +6103,7 @@ dee.su, 1 deep.club, 1 deeparamaraj.com, 1 deepbluecrafting.co.uk, 1 +deepcreampie.com, 1 deeprecce.com, 1 deepserve.info, 1 deepsouthsounds.com, 1 @@ -6154,7 +6153,6 @@ dejure.org, 1 dejw.cz, 1 delahrzolder.nl, 1 delbecqvo.be, 1 -delbrouck.ch, 1 deleidscheflesch.nl, 1 delfic.org, 1 delhionlinegifts.com, 1 @@ -6513,6 +6511,7 @@ dimonb.com, 1 din-tools.com, 1 dineachook.com.au, 1 dinepont.fr, 1 +dingcc.com, 1 dingcc.org, 1 dingcc.xyz, 1 dinge.xyz, 1 @@ -6559,7 +6558,7 @@ discofitta.com, 1 disconformity.net, 1 discord-chan.net, 1 discordapp.com, 1 -discotek.club, 0 +discotek.club, 1 discountmetaux.fr, 1 discover-mercure.com, 1 discoverhealthage.com, 0 @@ -6714,7 +6713,6 @@ dogfi.sh, 1 dogft.com, 1 doggroomingcourse.com, 1 dogmap.jp, 1 -dognlife.com, 1 dogoo.com, 1 dogworld.com.br, 1 dohanews.co, 1 @@ -6724,6 +6722,7 @@ doku-gilde.de, 1 dokuboard.com, 1 dokuraum.de, 1 dolarcanadense.com.br, 1 +dolcevitatech.education, 1 doleta.gov, 1 doli.se, 1 dolice.net, 1 @@ -6795,6 +6794,7 @@ donthedragonwilson.com, 1 dontpayfull.com, 1 donttrust.me, 1 donutcompany.co.jp, 1 +dooby.fr, 1 doodlefinder.de, 1 dooleylabs.com, 1 dooleytackaberry.com, 1 @@ -7074,6 +7074,7 @@ dustri.org, 1 dustygroove.com, 1 dustyspokesbnb.ca, 1 dutch1.nl, 1 +dutchessuganda.com, 1 dutchrank.nl, 1 dutchwanderers.nl, 1 dutchweballiance.nl, 1 @@ -8454,7 +8455,6 @@ feel.aero, 1 feelgood-workouts.de, 1 feen.us, 1 fefelovalex.ru, 1 -fegans.org.uk, 1 fehngarten.de, 1 fehnladen.de, 1 feigling.net, 1 @@ -8592,6 +8592,7 @@ film-tutorial.com, 1 film.photography, 1 film.photos, 1 filmatiporno.xxx, 1 +filme-online.eu.com, 1 filme-onlines.com, 1 filmreviewonline.com, 1 filmserver.de, 1 @@ -8625,7 +8626,6 @@ finsprings.org, 1 finstererlebnis.de, 1 finsterlebnis.de, 1 fintandunleavy.com, 1 -fintechnics.com, 1 finvantage.com, 1 fionamcbride.com, 1 fire-wolf.com, 1 @@ -9178,7 +9178,7 @@ frogatto.com, 1 frogeye.fr, 1 froggitt.com, 1 frogsonamission.de, 1 -froh.co.jp, 0 +froh.co.jp, 1 frokenblomma.se, 1 frolov.net, 1 frolova.org, 1 @@ -9305,6 +9305,7 @@ futuresonline.com, 1 futurezone.at, 1 futuristarchitecture.com, 1 futurope.com, 1 +fuwafuwa.moe, 1 fuyu.moe, 1 fuzoku-sodan.com, 1 fuzzing-project.org, 1 @@ -9474,6 +9475,7 @@ gaytorrent.ru, 1 gayxsite.com, 1 gazee.net, 1 gazellegames.net, 1 +gbc-radio.nl, 1 gbcsummercamps.com, 1 gbl.selfip.net, 1 gc-mc.de, 1 @@ -9536,6 +9538,7 @@ geekzone.fr, 1 geertdegraaf.nl, 1 geertswei.nl, 1 gegeco.ch, 1 +geh.li, 1 gehaowu.com, 1 gehreslaw.com, 1 gehrke.nrw, 1 @@ -9842,6 +9845,7 @@ globalnomadvintage.com, 1 globalonetechnology.com, 1 globalperspectivescanada.com, 1 globalprojetores.com.br, 1 +globaltennis.ca, 1 globalventil.com, 1 globalvisions-events.ch, 1 globalvisions-events.com, 1 @@ -10965,7 +10969,6 @@ holoxplor.space, 1 holydragoon.jp, 1 holyhiphopdatabase.com, 1 holymolycasinos.com, 1 -holytransaction.com, 1 holywhite.com, 1 holz.nu, 1 holzheizer-forum.de, 1 @@ -11366,7 +11369,7 @@ iclinic.ua, 1 icmhd.ch, 1 icmp2018.org, 1 icodeconnect.com, 1 -icodesign.me, 0 +icodesign.me, 1 iconomi.net, 1 icpc.pp.ua, 1 icpc2016.in.th, 1 @@ -11413,7 +11416,6 @@ idexxpublicationportal.com, 1 idgard.de, 1 idhosts.co.id, 1 idid.tk, 1 -idinby.dk, 1 idiopolis.org, 1 idiotentruppe.de, 1 idmanagement.gov, 1 @@ -11553,6 +11555,7 @@ imaginary.ca, 1 imaginarymakings.me, 1 imagine-programming.com, 1 imagr.io, 1 +imanageproducts.uk, 1 imanhearts.com, 1 imanudin.net, 1 imawhale.com, 1 @@ -11740,6 +11743,7 @@ initramfs.io, 1 initrd.net, 1 injust.eu.org, 1 ink.horse, 1 +inkable.com.au, 1 inkbunny.net, 0 inkhor.se, 1 inkontriamoci.com, 1 @@ -12057,6 +12061,7 @@ iskaron.de, 1 iskogen.nu, 1 islam.si, 1 islandhosting.com, 1 +islandinthenet.com, 1 islandpumpandtank.com, 1 islandzero.net, 1 islazia.fr, 1 @@ -12194,7 +12199,6 @@ ivanpolchenko.com, 1 ivaoru.org, 1 ivfausland.de, 1 ivfmeds.com, 1 -ivi-co.com, 1 ivi-fertilite.fr, 1 ivi-fruchtbarkeit.de, 1 ivi.com.ar, 1 @@ -12286,6 +12290,7 @@ jahner.xyz, 1 jahofmann.de, 1 jailbreakingisnotacrime.org, 1 jaimechanaga.com, 1 +jaion.ml, 1 jaispirit.com, 1 jaitnetworking.com, 0 jakarta.dating, 1 @@ -12400,7 +12405,6 @@ jayfreestone.com, 1 jayharris.ca, 1 jaymecd.rocks, 1 jayna.design, 1 -jayxon.com, 1 jayxu.com, 1 jazz-alliance.com, 1 jazz-alliance.org, 1 @@ -12570,7 +12574,6 @@ jlhmedia.com, 1 jlkhosting.com, 1 jlr-luxembourg.com, 1 jm-bea.net, 1 -jm06.com, 1 jmarciniak.it, 1 jmb.lc, 1 jmbelloteau.com, 1 @@ -12591,6 +12594,7 @@ jnjdj.com, 1 jnm-art.com, 1 joa-ebert.com, 1 joaosampaio.com.br, 1 +job-offer.de, 1 jobbkk.com, 1 joblife.co.za, 1 jobmedic.com, 1 @@ -12902,6 +12906,7 @@ kabat-fans.cz, 1 kabeuchi.com, 1 kaboom.pw, 1 kabu-abc.com, 1 +kabus.org, 1 kachlikova2.cz, 1 kack.website, 1 kadmec.com, 1 @@ -13310,7 +13315,6 @@ kinozal-tv.appspot.com, 1 kinsights.com, 0 kinsmenhomelottery.com, 1 kintawifi.com, 0 -kintoandar.com, 1 kintone.com, 1 kintore.tv, 1 kintzingerfilm.de, 1 @@ -13364,7 +13368,6 @@ kiwipayments.com, 1 kiwiplace.com, 1 kj1391.com, 1 kj1396.net, 1 -kj1397.com, 1 kjaer.io, 1 kjarni.cc, 1 kjarrval.is, 1 @@ -13852,7 +13855,6 @@ lampenwelt.ch, 1 lan2k.org, 1 lanbroa.eu, 1 lanbyte.se, 1 -lancehoteis.com, 1 lancejames.com, 1 lancelafontaine.com, 1 lanceyip.com, 1 @@ -13880,6 +13882,7 @@ lantian.pub, 1 lanuovariviera.it, 1 lanyang.tk, 1 lanzamientovirtual.es, 1 +lanzarote-online.info, 1 laos.dating, 1 laospage.com, 1 laozhu.me, 1 @@ -14002,7 +14005,6 @@ lbgconsultores.com, 1 lbihrhelpdesk.com, 1 lbs-logics.com, 1 lca-pv.de, 1 -lcht.ch, 1 lcti.biz, 1 ld-begunjscica.si, 1 ldc.com.br, 0 @@ -14615,7 +14617,6 @@ logostock.jp, 1 logue.be, 1 lohanaflores.com.br, 1 loichot.ch, 1 -loisircreatif.net, 1 lojadamimo.com.br, 1 lojadanidrea.com.br, 1 lojadewhisky.com.br, 1 @@ -14932,7 +14933,7 @@ maces-net.de, 1 mach-politik.ch, 1 macha.cloud, 1 machbach.com, 1 -machikka.com, 1 +machikka.com, 0 machon.biz, 0 macht-elektro.de, 1 machtweb.de, 1 @@ -14999,6 +15000,7 @@ magenda.sk, 1 magentaize.net, 1 magi.systems, 1 magicball.co, 1 +magicbroccoli.de, 0 magiclen.org, 1 magicspaceninjapirates.de, 0 magictable.com, 1 @@ -15259,7 +15261,6 @@ markow.io, 1 markprof.ru, 1 markrego.com, 1 markri.nl, 0 -markrobin.de, 1 marksouthall.com, 1 markspres.org, 1 markt-heiligenstadt.de, 0 @@ -15411,6 +15412,7 @@ mattli.us, 1 mattmccutchen.net, 1 mattonline.me, 1 mattwb65.com, 1 +mattwservices.co.uk, 1 matviet.vn, 1 matze.co, 1 matze.org, 1 @@ -15538,7 +15540,6 @@ mdcloudps.com, 1 mdek.at, 1 mdewendt.de, 1 mdf-bis.com, 1 -mdkr.nl, 1 mdma.net, 1 mdmed.clinic, 1 mdosch.de, 1 @@ -15797,6 +15798,7 @@ mflodin.se, 1 mfrsgb45.org, 1 mft.global, 1 mghiorzi.com.ar, 0 +mgknet.com, 1 mgoessel.de, 1 mgrossklaus.de, 1 mgrt.net, 1 @@ -15895,6 +15897,7 @@ mikedugan.org, 1 mikegarnett.co.uk, 1 mikegerwitz.com, 1 mikehamburg.com, 1 +mikek.work, 1 mikes.tk, 1 miketabor.com, 1 miketheuer.com, 1 @@ -15970,7 +15973,6 @@ minenash.com, 1 minepay.net, 1 minepic.org, 1 minepod.fr, 1 -minesouls.fr, 1 minez-nightswatch.com, 0 minf3-games.de, 1 mingo.nl, 1 @@ -15978,6 +15980,7 @@ mingram.net, 1 mingwah.ch, 1 mingy.ddns.net, 1 minhanossasenhora.com.br, 1 +mini2.fi, 1 minigolf-reisinger.com, 1 minikidz.es, 1 minikneet.com, 1 @@ -16478,6 +16481,7 @@ mts-server.com, 1 mtsolar.es, 1 muabannhanh.com, 0 mubiflex.nl, 1 +muchohentai.com, 1 muckingabout.eu, 1 muehlemann.net, 1 muellapp.com, 1 @@ -17394,6 +17398,7 @@ nikksno.io, 1 niklasbabel.com, 1 nikobradshaw.com, 1 nikolaichik.photo, 1 +nikolasbradshaw.com, 1 nikolasgrottendieck.com, 1 nikomo.fi, 0 nikz.in, 1 @@ -17849,6 +17854,7 @@ oftamedic.com, 1 oftn.org, 1 oge.ch, 1 ogis.gov, 1 +ogkw.de, 1 oglen.ca, 1 ogocare.com, 1 oguya.ch, 1 @@ -18373,9 +18379,7 @@ panascais.com, 1 panascais.de, 1 panascais.eu, 1 panascais.host, 1 -panascais.io, 1 panascais.me, 1 -panascais.net, 1 panascais.pw, 1 panascais.site, 1 panascais.tech, 1 @@ -18559,6 +18563,7 @@ pauladamsmith.com, 1 paulbakaus.com, 1 paulbdelaat.nl, 1 paulbramhall.uk, 1 +paulchen.at, 1 pauldcox.com, 1 paulerhof.com, 1 paulewen.ca, 1 @@ -19149,6 +19154,7 @@ playkh.com, 1 playmaza.live, 1 playmfe.com, 1 playpirates.com, 1 +playsharp.com, 1 playsnake.org, 1 playsoundevents.be, 1 playsource.co, 1 @@ -19570,6 +19576,8 @@ prodsim.ninja, 1 productbarcodes.com, 1 productdesignsoftware.com.au, 1 productgap.com, 1 +productived.net, 1 +productpeo.pl, 1 proefteksten.nl, 0 prof.ch, 1 profection.biz, 1 @@ -19754,7 +19762,6 @@ public-g.de, 1 public-projects.com, 1 public-projects.de, 1 public-vocals.de, 1 -publications.qld.gov.au, 0 publiccarauctionscalifornia.com, 1 publicintegrity.org, 1 publicintelligence.net, 1 @@ -19979,7 +19986,6 @@ r-core.org, 1 r-cut.fr, 1 r-rwebdesign.com, 1 r0t.co, 1 -r0uzic.net, 1 r2d2pc.com, 1 r3nt3r.com, 1 r3s1stanc3.me, 1 @@ -20325,7 +20331,6 @@ regionale.org, 1 regiosalland.nl, 1 regiovertrieb.de, 0 register.gov.uk, 1 -registertovoteflorida.gov, 1 registrar.io, 1 regmyr.se, 1 regnix.net, 1 @@ -20837,7 +20842,6 @@ rothkranz.net, 1 rothnater.ch, 1 rotol.me, 1 rotozen.com, 1 -rotter-dam.nl, 1 rotterdamjazz.info, 1 rottweil-hilft.de, 1 rotunneling.net, 1 @@ -21333,7 +21337,6 @@ sbit.com.br, 1 sblum.de, 1 sbm.cloud, 1 sbo-dresden.de, 1 -sbobetfun.com, 1 sbr.red, 1 sbsavings.bank, 1 sbssoft.ru, 1 @@ -21359,6 +21362,7 @@ schaper-sport.com, 1 schatmeester.be, 1 schatzibaers.de, 1 schau-rein.co.at, 1 +schawe.me, 1 schd.io, 1 scheduleme.io, 1 scheemadigital.com, 1 @@ -21589,6 +21593,7 @@ seconfig.sytes.net, 1 secpatrol.de, 1 secretar.is, 1 secretofanah.com, 1 +secretpanties.com, 1 secretsanta.fr, 1 secretserveronline.com, 1 secretum.tech, 1 @@ -21762,6 +21767,7 @@ seosof.com, 1 seoul.dating, 1 seouniversity.org, 1 sep23.ru, 1 +sepalandseed.com, 1 sephr.com, 1 sepie.gob.es, 1 seppelec.com, 1 @@ -22463,6 +22469,7 @@ slrd-isperih.com, 1 slse.ca, 1 sluitkampzeist.nl, 0 sluplift.com, 1 +slvh.fr, 1 slwilde.ca, 1 slxh.eu, 1 slxh.nl, 1 @@ -22508,6 +22515,7 @@ smartpolicingplatform.com, 1 smartrade.tech, 1 smartshiftme.com, 1 smartship.co.jp, 1 +smartshoppers.es, 1 smartsparrow.com, 1 smartvideo.io, 1 smartviewing.com, 1 @@ -22981,6 +22989,7 @@ squido.ch, 1 squidparty.com, 1 squids.space, 1 squirtlesbians.net, 1 +sqzryang.com, 1 sr-cs.net, 1 srandom.com, 1 srbija-nekretnine.org, 1 @@ -23225,7 +23234,6 @@ stichtingliab.nl, 1 stichtingscholierenvervoerzeeland.nl, 1 stichtingsticky.nl, 1 stick2bike.de, 1 -stickies.io, 1 stickswag.cf, 1 stift-kremsmuenster.at, 1 stig.io, 1 @@ -23453,11 +23461,12 @@ sundaycooks.com, 1 sundayfundayjapan.com, 1 suneilpatel.com, 1 sunfireshop.com.br, 1 -sunflyer.cn, 0 sunfox.cz, 1 +sunfulong.me, 1 sungo.wtf, 1 sunjaydhama.com, 1 sunn.ie, 1 +sunsetwx.com, 1 sunshinesf.org, 1 sunsmartresorts.com, 1 sunstar.bg, 1 @@ -23597,7 +23606,6 @@ swissid.ch, 1 swisslinux.org, 1 swisswebhelp.ch, 1 swissxperts.ch, 1 -swite.com, 1 swordfeng.xyz, 1 swuosa.org, 1 swvaux.com, 1 @@ -24039,7 +24047,7 @@ tenberg.com, 1 tenbos.ch, 1 tendermaster.com.ua, 1 tenderstem.co.uk, 1 -tendoryu-aikido.org, 0 +tendoryu-aikido.org, 1 tenenz.com, 1 tengu.cloud, 1 tenispopular.com, 1 @@ -24333,6 +24341,7 @@ theploughharborne.co.uk, 1 theposhfudgecompany.co.uk, 1 thepostoffice.ro, 1 theprincegame.com, 1 +theprivacysolution.com, 1 thepromisemusic.com, 1 thequillmagazine.org, 1 theragran.co.id, 1 @@ -24622,6 +24631,7 @@ tjl.rocks, 1 tjp.ch, 1 tjs.me, 1 tkacz.pro, 1 +tkarstens.de, 0 tkat.ch, 1 tkgpm.com, 1 tkjg.fi, 1 @@ -25719,7 +25729,6 @@ vacuumreviewcenter.com, 1 vadennissanofhiltonheadparts.com, 1 vadennissanofhinesvilleparts.com, 1 vadik.me, 1 -vadodesign.nl, 1 vaeplatform.com, 1 vaew.com, 1 vagabond.fr, 1 @@ -26140,6 +26149,7 @@ vm-0.com, 1 vm-co.ch, 1 vmc.co.id, 1 vmem.jp, 1 +vmgirls.com, 1 vmis.nl, 1 vmoagents.com, 0 vmug.pl, 1 @@ -26336,6 +26346,7 @@ wangql.net, 1 wangqr.tk, 1 wangyue.blog, 1 wantshow.com.br, 1 +wanybug.cn, 1 wapking.live, 1 wardow.com, 1 warekon.com, 1 @@ -26377,7 +26388,6 @@ waterfedpole.com, 1 watermonitor.gov, 1 watertrails.io, 1 watsonwork.me, 1 -wattechweb.com, 1 wave-ola.es, 1 wavesboardshop.com, 1 wavesoftime.com, 1 @@ -26387,6 +26397,7 @@ waylaydesign.com, 1 wayne.cloud, 0 wayohoo.com, 1 wayohoo.net, 1 +waytt.cf, 1 waze.com, 1 wbci.us, 1 wbg-vs.de, 1 @@ -26795,7 +26806,6 @@ wilane.org, 1 wild-emotion-events.de, 1 wildboaratvparts.com, 1 wildcard.hu, 1 -wilddog.com, 1 wilddogdesign.co.uk, 1 wildewood.ca, 1 wildnisfamilie.net, 1 @@ -27124,6 +27134,7 @@ www-8887999.com, 0 www.aclu.org, 0 www.airbnb.com, 1 www.amazon.ca, 1 +www.amazon.cn, 1 www.amazon.co.jp, 1 www.amazon.co.uk, 1 www.amazon.com, 1 @@ -27275,6 +27286,7 @@ xichuangke.com, 0 xicreative.net, 1 xight.org, 1 xilef.org, 1 +xiliant.com, 1 xilkoi.net, 1 ximage.me, 0 ximbo.net, 1 @@ -27661,7 +27673,6 @@ yourself.today, 1 yourticketbooking.com, 1 youruseragent.info, 1 yourznc.com, 1 -youss.cc, 0 yout.com, 1 youtous.me, 1 youtubedownloader.com, 1 @@ -27675,6 +27686,7 @@ ypid.de, 1 yplanapp.com, 1 yr166166.com, 1 yryz.net, 1 +ys-shop.biz, 1 ysicorp.com, 1 yslbeauty.com, 1 ytec.ca, 1 @@ -27685,6 +27697,7 @@ ytreza.fr, 1 ytuquelees.net, 1 yu.gg, 0 yu.vc, 1 +yuan.ga, 1 yuanben.io, 1 yuanbenlian.com, 1 yubi.co, 1 @@ -27734,6 +27747,8 @@ yukonlip.com, 1 yukontec.com, 1 yum.beer, 1 yumeconcert.com, 1 +yuna.love, 1 +yuna.tg, 1 yunity.org, 1 yunjishou.pro, 1 yuricarlenzoli.it, 1 @@ -27875,7 +27890,6 @@ zfree.co.nz, 1 zgrep.org, 1 zhang-hao.com, 1 zhangfangzhou.com, 1 -zhangge.net, 1 zhanghao.me, 1 zhangsidan.com, 1 zhangsir.net, 1 @@ -27940,7 +27954,6 @@ zojadravai.com, 1 zoki.art, 1 zokster.net, 1 zolokar.xyz, 1 -zolotoy-standart.com.ua, 1 zombiesecured.com, 1 zomerschoen.nl, 1 zone39.com, 1 @@ -27967,6 +27980,7 @@ zor.com, 1 zorgclustertool.nl, 1 zorium.org, 1 zorntt.fr, 1 +zorz.info, 1 zotero.org, 1 zouk.info, 1 zqwqz.com, 1 @@ -28021,13 +28035,13 @@ zxity.co.uk, 1 zxity.ltd, 1 zxity.uk, 1 zxtcode.com, 1 -zybbo.com, 1 zymmm.com, 1 zypern-firma.com, 1 zypr.pw, 1 zyria.de, 1 zyul.ddns.net, 1 zyx.im, 0 +zyzardx.com, 1 zzb510.com, 1 zzb6688.com, 1 zzsec.org, 1 diff --git a/storage/TelemetryVFS.cpp b/storage/TelemetryVFS.cpp index 58b412c26dc8..9416772a78cf 100644 --- a/storage/TelemetryVFS.cpp +++ b/storage/TelemetryVFS.cpp @@ -834,6 +834,11 @@ xNextSystemCall(sqlite3_vfs *vfs, const char *zName) namespace mozilla { namespace storage { +const char *GetVFSName() +{ + return "telemetry-vfs"; +} + sqlite3_vfs* ConstructTelemetryVFS() { #if defined(XP_WIN) @@ -867,7 +872,7 @@ sqlite3_vfs* ConstructTelemetryVFS() MOZ_ASSERT(vfs->iVersion <= LAST_KNOWN_VFS_VERSION); tvfs->szOsFile = sizeof(telemetry_file) - sizeof(sqlite3_file) + vfs->szOsFile; tvfs->mxPathname = vfs->mxPathname; - tvfs->zName = "telemetry-vfs"; + tvfs->zName = GetVFSName(); tvfs->pAppData = vfs; tvfs->xOpen = xOpen; tvfs->xDelete = xDelete; diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp index aa49bbbaa90e..f3391776f574 100644 --- a/storage/mozStorageConnection.cpp +++ b/storage/mozStorageConnection.cpp @@ -73,6 +73,8 @@ namespace storage { using mozilla::dom::quota::QuotaObject; +const char *GetVFSName(); + namespace { int @@ -627,7 +629,7 @@ Connection::initialize() AUTO_PROFILER_LABEL("Connection::initialize", STORAGE); // in memory database requested, sqlite uses a magic file name - int srv = ::sqlite3_open_v2(":memory:", &mDBConn, mFlags, nullptr); + int srv = ::sqlite3_open_v2(":memory:", &mDBConn, mFlags, GetVFSName()); if (srv != SQLITE_OK) { mDBConn = nullptr; return convertResultCode(srv); @@ -660,7 +662,7 @@ Connection::initialize(nsIFile *aDatabaseFile) #else static const char* sIgnoreLockingVFS = "unix-none"; #endif - const char* vfs = mIgnoreLockingMode ? sIgnoreLockingVFS : nullptr; + const char* vfs = mIgnoreLockingMode ? sIgnoreLockingVFS : GetVFSName(); int srv = ::sqlite3_open_v2(NS_ConvertUTF16toUTF8(path).get(), &mDBConn, mFlags, vfs); @@ -694,7 +696,7 @@ Connection::initialize(nsIFileURL *aFileURL) rv = aFileURL->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); - int srv = ::sqlite3_open_v2(spec.get(), &mDBConn, mFlags, nullptr); + int srv = ::sqlite3_open_v2(spec.get(), &mDBConn, mFlags, GetVFSName()); if (srv != SQLITE_OK) { mDBConn = nullptr; return convertResultCode(srv); diff --git a/storage/mozStorageService.cpp b/storage/mozStorageService.cpp index 7c3cba8c1533..6439e60261cb 100644 --- a/storage/mozStorageService.cpp +++ b/storage/mozStorageService.cpp @@ -24,6 +24,7 @@ #include "mozIStoragePendingStatement.h" #include "sqlite3.h" +#include "mozilla/AutoSQLiteLifetime.h" #ifdef SQLITE_OS_WIN // "windows.h" was included and it can #define lots of things we care about... @@ -32,13 +33,6 @@ #include "nsIPromptService.h" -#ifdef MOZ_STORAGE_MEMORY -# include "mozmemory.h" -# ifdef MOZ_DMD -# include "DMD.h" -# endif -#endif - //////////////////////////////////////////////////////////////////////////////// //// Defines @@ -282,12 +276,6 @@ Service::~Service() if (rc != SQLITE_OK) NS_WARNING("Failed to unregister sqlite vfs wrapper."); - // Shutdown the sqlite3 API. Warn if shutdown did not turn out okay, but - // there is nothing actionable we can do in that case. - rc = ::sqlite3_shutdown(); - if (rc != SQLITE_OK) - NS_WARNING("sqlite3 did not shutdown cleanly."); - shutdown(); // To release sXPConnect. gService = nullptr; @@ -400,121 +388,7 @@ Service::shutdown() } sqlite3_vfs *ConstructTelemetryVFS(); - -#ifdef MOZ_STORAGE_MEMORY - -namespace { - -// By default, SQLite tracks the size of all its heap blocks by adding an extra -// 8 bytes at the start of the block to hold the size. Unfortunately, this -// causes a lot of 2^N-sized allocations to be rounded up by jemalloc -// allocator, wasting memory. For example, a request for 1024 bytes has 8 -// bytes added, becoming a request for 1032 bytes, and jemalloc rounds this up -// to 2048 bytes, wasting 1012 bytes. (See bug 676189 for more details.) -// -// So we register jemalloc as the malloc implementation, which avoids this -// 8-byte overhead, and thus a lot of waste. This requires us to provide a -// function, sqliteMemRoundup(), which computes the actual size that will be -// allocated for a given request. SQLite uses this function before all -// allocations, and may be able to use any excess bytes caused by the rounding. -// -// Note: the wrappers for malloc, realloc and moz_malloc_usable_size are -// necessary because the sqlite_mem_methods type signatures differ slightly -// from the standard ones -- they use int instead of size_t. But we don't need -// a wrapper for free. - -#ifdef MOZ_DMD - -// sqlite does its own memory accounting, and we use its numbers in our memory -// reporters. But we don't want sqlite's heap blocks to show up in DMD's -// output as unreported, so we mark them as reported when they're allocated and -// mark them as unreported when they are freed. -// -// In other words, we are marking all sqlite heap blocks as reported even -// though we're not reporting them ourselves. Instead we're trusting that -// sqlite is fully and correctly accounting for all of its heap blocks via its -// own memory accounting. Well, we don't have to trust it entirely, because -// it's easy to keep track (while doing this DMD-specific marking) of exactly -// how much memory SQLite is using. And we can compare that against what -// SQLite reports it is using. - -MOZ_DEFINE_MALLOC_SIZE_OF_ON_ALLOC(SqliteMallocSizeOfOnAlloc) -MOZ_DEFINE_MALLOC_SIZE_OF_ON_FREE(SqliteMallocSizeOfOnFree) - -#endif - -static void *sqliteMemMalloc(int n) -{ - void* p = ::malloc(n); -#ifdef MOZ_DMD - gSqliteMemoryUsed += SqliteMallocSizeOfOnAlloc(p); -#endif - return p; -} - -static void sqliteMemFree(void *p) -{ -#ifdef MOZ_DMD - gSqliteMemoryUsed -= SqliteMallocSizeOfOnFree(p); -#endif - ::free(p); -} - -static void *sqliteMemRealloc(void *p, int n) -{ -#ifdef MOZ_DMD - gSqliteMemoryUsed -= SqliteMallocSizeOfOnFree(p); - void *pnew = ::realloc(p, n); - if (pnew) { - gSqliteMemoryUsed += SqliteMallocSizeOfOnAlloc(pnew); - } else { - // realloc failed; undo the SqliteMallocSizeOfOnFree from above - gSqliteMemoryUsed += SqliteMallocSizeOfOnAlloc(p); - } - return pnew; -#else - return ::realloc(p, n); -#endif -} - -static int sqliteMemSize(void *p) -{ - return ::moz_malloc_usable_size(p); -} - -static int sqliteMemRoundup(int n) -{ - n = malloc_good_size(n); - - // jemalloc can return blocks of size 2 and 4, but SQLite requires that all - // allocations be 8-aligned. So we round up sub-8 requests to 8. This - // wastes a small amount of memory but is obviously safe. - return n <= 8 ? 8 : n; -} - -static int sqliteMemInit(void *p) -{ - return 0; -} - -static void sqliteMemShutdown(void *p) -{ -} - -const sqlite3_mem_methods memMethods = { - &sqliteMemMalloc, - &sqliteMemFree, - &sqliteMemRealloc, - &sqliteMemSize, - &sqliteMemRoundup, - &sqliteMemInit, - &sqliteMemShutdown, - nullptr -}; - -} // namespace - -#endif // MOZ_STORAGE_MEMORY +const char *GetVFSName(); static const char* sObserverTopics[] = { "memory-pressure", @@ -527,28 +401,13 @@ Service::initialize() { MOZ_ASSERT(NS_IsMainThread(), "Must be initialized on the main thread"); - int rc; - -#ifdef MOZ_STORAGE_MEMORY - rc = ::sqlite3_config(SQLITE_CONFIG_MALLOC, &memMethods); - if (rc != SQLITE_OK) - return convertResultCode(rc); -#endif - - // TODO (bug 1191405): do not preallocate the connections caches until we - // have figured the impact on our consumers and memory. - sqlite3_config(SQLITE_CONFIG_PAGECACHE, NULL, 0, 0); - - // Explicitly initialize sqlite3. Although this is implicitly called by - // various sqlite3 functions (and the sqlite3_open calls in our case), - // the documentation suggests calling this directly. So we do. - rc = ::sqlite3_initialize(); + int rc = AutoSQLiteLifetime::getInitResult(); if (rc != SQLITE_OK) return convertResultCode(rc); mSqliteVFS = ConstructTelemetryVFS(); if (mSqliteVFS) { - rc = sqlite3_vfs_register(mSqliteVFS, 1); + rc = sqlite3_vfs_register(mSqliteVFS, 0); if (rc != SQLITE_OK) return convertResultCode(rc); } else { diff --git a/taskcluster/ci/build/linux.yml b/taskcluster/ci/build/linux.yml index b2c07a837fb8..d6e34ae088ff 100644 --- a/taskcluster/ci/build/linux.yml +++ b/taskcluster/ci/build/linux.yml @@ -621,7 +621,7 @@ linux64-ccov/opt: tooltool-downloads: public need-xvfb: true toolchains: - - linux64-clang + - linux64-clang-4 - linux64-rust - linux64-gcc diff --git a/taskcluster/ci/test/tests.yml b/taskcluster/ci/test/tests.yml index c1423dd55db4..d0548035b1b0 100644 --- a/taskcluster/ci/test/tests.yml +++ b/taskcluster/ci/test/tests.yml @@ -779,10 +779,6 @@ mochitest-gpu: treeherder-symbol: tc-M(gpu) loopback-video: true virtualization: virtual-with-gpu - worker-type: - by-test-platform: - windows10-64.*: buildbot-bridge/buildbot-bridge - default: null e10s: by-test-platform: windows7-32/debug: both diff --git a/taskcluster/taskgraph/transforms/coalesce.py b/taskcluster/taskgraph/transforms/coalesce.py index 3b643fff187d..ed557e39bf0a 100644 --- a/taskcluster/taskgraph/transforms/coalesce.py +++ b/taskcluster/taskgraph/transforms/coalesce.py @@ -34,6 +34,7 @@ def enable_coalescing(config, jobs): 'aws-provisioner-v1/gecko-t-win7-32', 'aws-provisioner-v1/gecko-t-win7-32-gpu', 'aws-provisioner-v1/gecko-t-win10-64', + 'aws-provisioner-v1/gecko-t-win10-64-gpu', ]: job['coalesce'] = { 'job-identifier': sha256(job["label"]).hexdigest()[:20], diff --git a/testing/mochitest/mach_commands.py b/testing/mochitest/mach_commands.py index e2462dec5887..a159ef9fc60d 100644 --- a/testing/mochitest/mach_commands.py +++ b/testing/mochitest/mach_commands.py @@ -411,6 +411,10 @@ class MachCommands(MachCommandBase): if result: overall = result + # Halt tests on keyboard interrupt + if result == -1: + break + # TODO consolidate summaries from all suites return overall diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index 458260874a02..1b3bc7426f78 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -1654,30 +1654,49 @@ toolbar#nav-bar { return browserEnv - def killNamedProc(self, pname): + def killNamedProc(self, pname, orphans=True): """ Kill processes matching the given command name """ self.log.info("Checking for %s processes..." % pname) - def _psInfo(line): - if pname in line: - self.log.info(line) + if HAVE_PSUTIL: + for proc in psutil.process_iter(): + try: + if proc.name() == pname: + procd = proc.as_dict(attrs=['pid', 'ppid', 'name', 'username']) + if proc.ppid() == 1 or not orphans: + self.log.info("killing %s" % procd) + killPid(proc.pid, self.log) + else: + self.log.info("NOT killing %s (not an orphan?)" % procd) + except: + # may not be able to access process info for all processes + continue + else: + def _psInfo(line): + if pname in line: + self.log.info(line) - process = mozprocess.ProcessHandler(['ps', '-f'], - processOutputLine=_psInfo) - process.run() - process.wait() + process = mozprocess.ProcessHandler(['ps', '-f'], + processOutputLine=_psInfo) + process.run() + process.wait() - def _psKill(line): - parts = line.split() - if len(parts) == 3 and parts[0].isdigit(): - pid = int(parts[0]) - if parts[2] == pname: - self.log.info("killing %s with pid %d" % (pname, pid)) - killPid(pid, self.log) - process = mozprocess.ProcessHandler(['ps', '-o', 'pid,ppid,comm'], - processOutputLine=_psKill) - process.run() - process.wait() + def _psKill(line): + parts = line.split() + if len(parts) == 3 and parts[0].isdigit(): + pid = int(parts[0]) + ppid = int(parts[1]) + if parts[2] == pname: + if ppid == 1 or not orphans: + self.log.info("killing %s (pid %d)" % (pname, pid)) + killPid(pid, self.log) + else: + self.log.info("NOT killing %s (pid %d) (not an orphan?)" % + (pname, pid)) + process = mozprocess.ProcessHandler(['ps', '-o', 'pid,ppid,comm'], + processOutputLine=_psKill) + process.run() + process.wait() def execute_start_script(self): if not self.start_script or not self.marionette: diff --git a/testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-offer.html.ini b/testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-offer.html.ini index e65b1bdb2da2..c327ebf1918f 100644 --- a/testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-offer.html.ini +++ b/testing/web-platform/meta/webrtc/RTCPeerConnection-setRemoteDescription-offer.html.ini @@ -1,5 +1,6 @@ [RTCPeerConnection-setRemoteDescription-offer.html] type: testharness + disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1401076 [Setting remote description multiple times with different offer should succeed] expected: FAIL diff --git a/toolkit/components/telemetry/TelemetryEnvironment.jsm b/toolkit/components/telemetry/TelemetryEnvironment.jsm index 94d7f395ca4a..d5a2fc7dd5d4 100644 --- a/toolkit/components/telemetry/TelemetryEnvironment.jsm +++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm @@ -201,6 +201,7 @@ const DEFAULT_ENVIRONMENT_PREFS = new Map([ ["browser.shell.checkDefaultBrowser", {what: RECORD_PREF_VALUE}], ["browser.search.ignoredJAREngines", {what: RECORD_DEFAULTPREF_VALUE}], ["browser.search.suggest.enabled", {what: RECORD_PREF_VALUE}], + ["browser.search.widget.inNavBar", {what: RECORD_DEFAULTPREF_VALUE}], ["browser.startup.homepage", {what: RECORD_PREF_STATE}], ["browser.startup.page", {what: RECORD_PREF_VALUE}], ["toolkit.cosmeticAnimations.enabled", {what: RECORD_PREF_VALUE}], diff --git a/toolkit/xre/AutoSQLiteLifetime.cpp b/toolkit/xre/AutoSQLiteLifetime.cpp new file mode 100644 index 000000000000..a122c4900530 --- /dev/null +++ b/toolkit/xre/AutoSQLiteLifetime.cpp @@ -0,0 +1,167 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#include "nsDebug.h" +#include "AutoSQLiteLifetime.h" +#include "sqlite3.h" + +#ifdef MOZ_STORAGE_MEMORY +# include "mozmemory.h" +# ifdef MOZ_DMD +# include "DMD.h" +# endif + +namespace { + +// By default, SQLite tracks the size of all its heap blocks by adding an extra +// 8 bytes at the start of the block to hold the size. Unfortunately, this +// causes a lot of 2^N-sized allocations to be rounded up by jemalloc +// allocator, wasting memory. For example, a request for 1024 bytes has 8 +// bytes added, becoming a request for 1032 bytes, and jemalloc rounds this up +// to 2048 bytes, wasting 1012 bytes. (See bug 676189 for more details.) +// +// So we register jemalloc as the malloc implementation, which avoids this +// 8-byte overhead, and thus a lot of waste. This requires us to provide a +// function, sqliteMemRoundup(), which computes the actual size that will be +// allocated for a given request. SQLite uses this function before all +// allocations, and may be able to use any excess bytes caused by the rounding. +// +// Note: the wrappers for malloc, realloc and moz_malloc_usable_size are +// necessary because the sqlite_mem_methods type signatures differ slightly +// from the standard ones -- they use int instead of size_t. But we don't need +// a wrapper for free. + +#ifdef MOZ_DMD + +// sqlite does its own memory accounting, and we use its numbers in our memory +// reporters. But we don't want sqlite's heap blocks to show up in DMD's +// output as unreported, so we mark them as reported when they're allocated and +// mark them as unreported when they are freed. +// +// In other words, we are marking all sqlite heap blocks as reported even +// though we're not reporting them ourselves. Instead we're trusting that +// sqlite is fully and correctly accounting for all of its heap blocks via its +// own memory accounting. Well, we don't have to trust it entirely, because +// it's easy to keep track (while doing this DMD-specific marking) of exactly +// how much memory SQLite is using. And we can compare that against what +// SQLite reports it is using. + +MOZ_DEFINE_MALLOC_SIZE_OF_ON_ALLOC(SqliteMallocSizeOfOnAlloc) +MOZ_DEFINE_MALLOC_SIZE_OF_ON_FREE(SqliteMallocSizeOfOnFree) + +#endif + +static void *sqliteMemMalloc(int n) +{ + void* p = ::malloc(n); +#ifdef MOZ_DMD + gSqliteMemoryUsed += SqliteMallocSizeOfOnAlloc(p); +#endif + return p; +} + +static void sqliteMemFree(void *p) +{ +#ifdef MOZ_DMD + gSqliteMemoryUsed -= SqliteMallocSizeOfOnFree(p); +#endif + ::free(p); +} + +static void *sqliteMemRealloc(void *p, int n) +{ +#ifdef MOZ_DMD + gSqliteMemoryUsed -= SqliteMallocSizeOfOnFree(p); + void *pnew = ::realloc(p, n); + if (pnew) { + gSqliteMemoryUsed += SqliteMallocSizeOfOnAlloc(pnew); + } else { + // realloc failed; undo the SqliteMallocSizeOfOnFree from above + gSqliteMemoryUsed += SqliteMallocSizeOfOnAlloc(p); + } + return pnew; +#else + return ::realloc(p, n); +#endif +} + +static int sqliteMemSize(void *p) +{ + return ::moz_malloc_usable_size(p); +} + +static int sqliteMemRoundup(int n) +{ + n = malloc_good_size(n); + + // jemalloc can return blocks of size 2 and 4, but SQLite requires that all + // allocations be 8-aligned. So we round up sub-8 requests to 8. This + // wastes a small amount of memory but is obviously safe. + return n <= 8 ? 8 : n; +} + +static int sqliteMemInit(void *p) +{ + return 0; +} + +static void sqliteMemShutdown(void *p) +{ +} + +const sqlite3_mem_methods memMethods = { + &sqliteMemMalloc, + &sqliteMemFree, + &sqliteMemRealloc, + &sqliteMemSize, + &sqliteMemRoundup, + &sqliteMemInit, + &sqliteMemShutdown, + nullptr +}; + +} // namespace + +#endif // MOZ_STORAGE_MEMORY + +namespace mozilla { + +AutoSQLiteLifetime::AutoSQLiteLifetime() +{ + if (++AutoSQLiteLifetime::sSingletonEnforcer != 1) { + NS_RUNTIMEABORT("multiple instances of AutoSQLiteLifetime constructed!"); + } + +#ifdef MOZ_STORAGE_MEMORY + sResult = ::sqlite3_config(SQLITE_CONFIG_MALLOC, &memMethods); +#else + sResult = SQLITE_OK; +#endif + + if (sResult == SQLITE_OK) { + // TODO (bug 1191405): do not preallocate the connections caches until we + // have figured the impact on our consumers and memory. + sqlite3_config(SQLITE_CONFIG_PAGECACHE, NULL, 0, 0); + + // Explicitly initialize sqlite3. Although this is implicitly called by + // various sqlite3 functions (and the sqlite3_open calls in our case), + // the documentation suggests calling this directly. So we do. + sResult = ::sqlite3_initialize(); + } +} + +AutoSQLiteLifetime::~AutoSQLiteLifetime() +{ + // Shutdown the sqlite3 API. Warn if shutdown did not turn out okay, but + // there is nothing actionable we can do in that case. + sResult = ::sqlite3_shutdown(); + NS_WARNING_ASSERTION(sResult == SQLITE_OK, + "sqlite3 did not shutdown cleanly."); +} + +int AutoSQLiteLifetime::sSingletonEnforcer = 0; +int AutoSQLiteLifetime::sResult = SQLITE_MISUSE; + +} // namespace mozilla diff --git a/toolkit/xre/AutoSQLiteLifetime.h b/toolkit/xre/AutoSQLiteLifetime.h new file mode 100644 index 000000000000..b62963622ea1 --- /dev/null +++ b/toolkit/xre/AutoSQLiteLifetime.h @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#ifndef mozilla_AutoSQLiteLifetime_h +#define mozilla_AutoSQLiteLifetime_h + +namespace mozilla { + +class AutoSQLiteLifetime final +{ +private: + static int sSingletonEnforcer; + static int sResult; +public: + AutoSQLiteLifetime(); + ~AutoSQLiteLifetime(); + static int getInitResult() { return AutoSQLiteLifetime::sResult; } +}; + +} // namespace mozilla + +#endif diff --git a/toolkit/xre/Bootstrap.cpp b/toolkit/xre/Bootstrap.cpp index bd80732fdf51..c19f0498d08f 100644 --- a/toolkit/xre/Bootstrap.cpp +++ b/toolkit/xre/Bootstrap.cpp @@ -6,11 +6,15 @@ #include "mozilla/Bootstrap.h" #include "nsXPCOM.h" +#include "AutoSQLiteLifetime.h" + namespace mozilla { class BootstrapImpl final : public Bootstrap { protected: + AutoSQLiteLifetime mSQLLT; + virtual void Dispose() override { delete this; diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build index 7a65cd5d296b..08bf452980b5 100644 --- a/toolkit/xre/moz.build +++ b/toolkit/xre/moz.build @@ -30,7 +30,7 @@ EXPORTS += [ 'nsIAppStartupNotifier.h', ] -EXPORTS.mozilla += ['Bootstrap.h'] +EXPORTS.mozilla += ['AutoSQLiteLifetime.h', 'Bootstrap.h'] if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']: EXPORTS += ['EventTracer.h'] @@ -91,6 +91,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': ] UNIFIED_SOURCES += [ + 'AutoSQLiteLifetime.cpp', 'Bootstrap.cpp', 'CreateAppData.cpp', 'nsAppStartupNotifier.cpp', diff --git a/xpcom/threads/nsProcessCommon.cpp b/xpcom/threads/nsProcessCommon.cpp index 4c5c278ddcb8..f4a3036907c2 100644 --- a/xpcom/threads/nsProcessCommon.cpp +++ b/xpcom/threads/nsProcessCommon.cpp @@ -122,7 +122,7 @@ nsProcess::Init(nsIFile* aExecutable) #if defined(XP_WIN) -// Out param `aWideCmdLine` must be PR_Freed by the caller. +// Out param `aWideCmdLine` must be free()d by the caller. static int assembleCmdLine(char* const* aArgv, wchar_t** aWideCmdLine, UINT aCodePage) {