NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception
# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
| function getHightlightCoords() { | |
| var pageIndex = PDFViewerApplication.pdfViewer.currentPageNumber - 1; | |
| var page = PDFViewerApplication.pdfViewer.getPageView(pageIndex); | |
| var pageRect = page.canvas.getClientRects()[0]; | |
| var selectionRects = window.getSelection().getRangeAt(0).getClientRects(); | |
| var viewport = page.viewport; | |
| var selected = selectionRects.map(function (r) { | |
| return viewport.convertToPdfPoint(r.left - pageRect.x, r.top - pageRect.y).concat( | |
| viewport.convertToPdfPoint(r.right - pageRect.x, r.bottom - pageRect.y)); | |
| }); |
NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception
# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
| // Keep the URL the same so the browser sees it as the same. | |
| channel.originalURI = aRequest.URI; | |
| channel.asyncOpen(proxy, aContext); | |
| var securityManager = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager); | |
| log('got secruity manager!'); | |
| var uri = ioService.newURI('resource://pdf.js/web/viewer.html', null, null); | |
| var principal = securityManager.getCodebasePrincipal(uri); | |
| log('created principal!'); | |
| channel.owner = principal; | |
| log('hey we changed the owner!'); |
| <!-- inside examples/ folder --> | |
| <!-- run `gulp dist-install` --> | |
| <html> | |
| <head> | |
| <script src="../node_modules/pdfjs-dist/build/pdf.js"></script> | |
| </head> | |
| <body> | |
| <script> | |
| PDFJS.cMapUrl = "../node_modules/pdfjs-dist/cmaps/"; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| </head> | |
| <body> | |
| <script> | |
| var memory; | |
| var env = { | |
| sys: { |
Provides set of operations to efficiently maintain set of patch for long time and be able to submit those for review.
Let's say we clone a repo and 'master' is upstream branch and we will keep it up-to-date on regular base.
We can created a branch for a new feature and will try to keep it fresh and with addressed reviews.
| var next = Promise.resolve(); | |
| var content = []; | |
| for (var i = 1; i <= PDFView.pdfDocument.numPages; i++) { | |
| next = next.then(function (pageNum) { | |
| return PDFView.pdfDocument.getPage(pageNum).then(function (page) { | |
| return page.getTextContent().then(function (tc) { | |
| content.push((tc.items || tc).map(function (x) { return x.str; }).join(' ')); | |
| }); | |
| }); | |
| }.bind(null, i)); |
| <IfModule mod_headers.c> | |
| Header set Access-Control-Allow-Origin "http://mozilla.github.io" | |
| </IfModule> |
This document describes how existing DWARF format can be extended and used with the WebAssembly binaries.
“[DWARF-SPEC]” references http://www.dwarfstd.org/doc/DWARF4.pdf
“[SOURCE-MAPS]” references WebAssembly/design#1051
“[WASM-LINKING]” references https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md
This is crude attempt to add DWARF-like information to the existing wasm source maps. It is not intendent to be used as a final solution, but provides overview of the information that can be used by a consumer/debugger of wasm code.
The source maps JSON is extended to add the x-scopes field at the top level that will contains all information generated by LLVM's llvm-dwarfdump command. To reduce burden of parsing at the consumer side, the dump will be converted to the JSON using following rules:
DW_TAG_xxx entity will be converted to a JS object with tag field with xxx value.children field will be added and will contain JS array.DW_AT_yyy attributes will be assigned at fields to the enclosing object with yyy name. Theirs values will be: