7 строки
12 MiB
JavaScript
7 строки
12 MiB
JavaScript
|
// This file contains Poppler, which is (C) the Poppler project, and available under the GNU GPL v2.
|
||
|
// and also FreeType, which is (C) the FreeType project, and also available under the GNU GPL v2.
|
||
|
|
||
|
|
||
|
|
||
|
"use strict";this["Module"]={};var args=arguments;var Runtime={stackAlloc:function stackAlloc(b){var a=STACKTOP;_memset(STACKTOP,0,b);STACKTOP+=b;STACKTOP=Math.ceil(STACKTOP/4)*4;return a},staticAlloc:function staticAlloc(b){var a=STATICTOP;STATICTOP+=b;STATICTOP=Math.ceil(STATICTOP/4)*4;return a},alignMemory:function alignMemory(b,c){var a=b=Math.ceil(b/(c?c:4))*(c?c:4);return a},isNumberType:function(a){return a in Runtime.INT_TYPES||a in Runtime.FLOAT_TYPES},isPointerType:function isPointerType(a){return pointingLevels(a)>0},isStructType:function isStructType(a){if(isPointerType(a)){return false}if(new RegExp(/^\[\d+\ x\ (.*)\]/g).test(a)){return true}return !Runtime.isNumberType(a)&&a[0]=="%"},INT_TYPES:{i1:0,i8:0,i16:0,i32:0,i64:0},FLOAT_TYPES:{"float":0,"double":0},getNativeFieldSize:function getNativeFieldSize(b,c){if(4==1){return 1}var a={_i1:1,_i8:1,_i16:2,_i32:4,_i64:8,_float:4,_double:8}["_"+b];if(!a){a=4}if(!c){a=Math.max(a,4)}return a},dedup:function dedup(b,c){var a={};if(c){return b.filter(function(d){if(a[d[c]]){return false}a[d[c]]=true;return true})}else{return b.filter(function(d){if(a[d]){return false}a[d]=true;return true})}},set:function set(){var b=typeof arguments[0]==="object"?arguments[0]:arguments;var a={};for(var c=0;c<b.length;c++){a[b[c]]=0}return a},calculateStructAlignment:function calculateStructAlignment(a){a.flatSize=0;a.alignSize=0;var c=[];var b=-1;a.flatIndexes=a.fields.map(function(g){var e,d;if(Runtime.isNumberType(g)||Runtime.isPointerType(g)){e=Runtime.getNativeFieldSize(g,true);d=e}else{if(Runtime.isStructType(g)){e=Types.types[g].flatSize;d=Types.types[g].alignSize}else{dprint("Unclear type in struct: "+g+", in "+a.name_);assert(0)}}d=Math.min(d,4);a.alignSize=Math.max(a.alignSize,d);var f=Runtime.alignMemory(a.flatSize,d);a.flatSize=f+e;if(b>=0){c.push(f-b)}b=f;return f});a.flatSize=Runtime.alignMemory(a.flatSize,a.alignSize);if(c.length==0){a.flatFactor=a.flatSize}else{if(Runtime.dedup(c).length==1){a.flatFactor=c[0]}}a.needsFlattening=(a.flatFactor!=1);return a.flatIndexes},__dummy__:0};var CorrectionsMonitor={MAX_ALLOWED:0,corrections:0,sigs:{},note:function(a){var b=a+"|"+new Error().stack;if(!this.sigs[b]){print("Correction: "+b);this.sigs[b]=0}this.sigs[b]++;this.corrections++;if(this.corrections>=this.MAX_ALLOWED){abort("\n\nToo many corrections!")}}};function __globalConstructor__(){}var __THREW__=false;var __ATEXIT__=[];var ABORT=false;var undef=0;function abort(a){print(a+":\n"+(new Error).stack);ABORT=true;throw"Assertion: "+a}function assert(b,a){if(!b){abort("Assertion failed: "+a)}}var ALLOC_NORMAL=0;var ALLOC_STACK=1;var ALLOC_STATIC=2;function Pointer_make(a,g,c){g=g?g:0;assert(g===0);if(a===HEAP){return g}var e=a.length;var d;for(d=0;d<e;d++){if(a[d]===undefined){throw"Invalid element in slab at "+new Error().stack}}var b=[_malloc,Runtime.stackAlloc,Runtime.staticAlloc][c?c:ALLOC_STATIC](Math.max(e,1));for(d=0;d<e;d++){var f=a[d];if(typeof f==="function"){f=Runtime.getFunctionIndex(f)}HEAP[b+d]=f}return b}Module.Pointer_make=Pointer_make;function Pointer_stringify(d){var a="";var c=0;var b;while(1){b=String.fromCharCode(HEAP[d+c]);if(b=="\0"){break}else{}a+=b;c+=1}return a}var PAGE_SIZE=4096;function alignMemoryPage(a){return Math.ceil(a/PAGE_SIZE)*PAGE_SIZE}var HEAP,IHEAP,FHEAP;var STACK_ROOT,STACKTOP,STACK_MAX;var STATICTOP;var HAS_TYPED_ARRAYS=false;var TOTAL_MEMORY=50*1024*1024;function __initializeRuntime__(){var a=TOTAL_MEMORY/32;IHEAP=FHEAP=HEAP=new Array(a);for(var b=0;b<a;b++){IHEAP[b]=FHEAP[b]=0}var d=intArrayFromString("(null)");for(var b=0;b<d.length;b++){HEAP[b]=d[b]}Module.HEAP=HEAP;Module.IHEAP=IHEAP;Module.FHEAP=FHEAP;STACK_ROOT=STACKTOP=alignMemoryPage(10);var c=1024*1024;try{c=TOTAL_STACK}catch(f){}STACK_MAX=STACK_ROOT+c;STATICTOP=alignMemoryPage(STACK_MAX)}function __shutdownRuntime__(){while(__ATEXIT__.length>0){var a=__ATEXIT__.pop();if(typeof a==="number"){a=FUNCTION_TABLE[a]}a()}}function Array_copy(b,a){return IHEAP.slice(b,b+a)}function String_len(b){var a=0;while(HEAP[b+a]){a++}return a}function String_copy(d,c){var a=String_len(d);i
|