Created
July 7, 2013 05:43
-
-
Save johan/5942446 to your computer and use it in GitHub Desktop.
Fixed function coverage in istanbul 0.1.40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* coffee-script example usage - at https://github.com/johan/dotjs/commits/johan | |
| given path_re: ['^/([^/]+)/([^/]+)(/?.*)', 'user', 'repo', 'rest'] | |
| query: true | |
| dom: | |
| keyboard: 'css .keyboard-shortcuts' | |
| branches: 'css+ .js-filter-branches h4 a' | |
| dates: 'css* .commit-group-heading' | |
| tracker: 'css? #gauges-tracker[defer]' | |
| johan_ci: 'xpath* //li[contains(@class,"commit")][.//a[.="johan"]]' | |
| ready: (path, query, dom) -> | |
| ...would make something like this call, as the path regexp matched, and there | |
| were DOM matches for the two mandatory "keyboard" and "branches" selectors: | |
| ready( { user: 'johan', repo: 'dotjs', rest: '/commits/johan' } | |
| , {} // would contain all query args (if any were present) | |
| , { keyboard: Node<a href="#keyboard_shortcuts_pane"> | |
| , branches: [ Node<a href="/johan/dotjs/commits/coffee"> | |
| , Node<a href="/johan/dotjs/commits/dirs"> | |
| , Node<a href="/johan/dotjs/commits/gh-pages"> | |
| , Node<a href="/johan/dotjs/commits/johan"> | |
| , Node<a href="/johan/dotjs/commits/jquery-1.8.2"> | |
| , Node<a href="/johan/dotjs/commits/master"> | |
| ] | |
| , dates: [ Node<h3 class="commit-group-heading">Oct 07, 2012</h3> | |
| , Node<h3 class="commit-group-heading">Aug 29, 2012</h3> | |
| , ... | |
| ] | |
| , tracker: null | |
| , johan_ci: [ Node<li class="commit">, ... ] | |
| } | |
| ) | |
| A selector returns an array of matches prefixed for "css*" and "css+" (ditto | |
| xpath), and a single result if it is prefixed "css" or "css?": | |
| If your script should only run on pages with a particular DOM node (or set of | |
| nodes), use the 'css' or 'css+' (ditto xpath) forms - and your callback won't | |
| get fired on pages that lack them. The 'css?' and 'css*' forms would run your | |
| callback but pass null or [] respectively, on not finding such nodes. You may | |
| recognize the semantics of x, x?, x* and x+ from regular expressions. | |
| (see http://goo.gl/ejtMD for a more thorough discussion of something similar) | |
| The dom property is recursively defined so you can make nested structures. | |
| If you want a property that itself is an object full of matched things, pass | |
| an object of sub-dom-spec:s, instead of a string selector: | |
| given dom: | |
| meta: | |
| base: 'xpath? /head/base | |
| title: 'xpath string(/head/title)' | |
| commits: 'css* li.commit' | |
| ready: (dom) -> | |
| You can also deconstruct repeated templated sections of a page into subarrays | |
| scraped as per your specs, by picking a context node for a dom spec. This is | |
| done by passing a two-element array: a selector resolving what node/nodes you | |
| look at and a dom spec describing how you want it/them deconstructed for you: | |
| given dom: | |
| meta: | |
| [ 'xpath /head', | |
| base: 'xpath? base | |
| title: 'xpath string(title)' | |
| ] | |
| commits: | |
| [ 'css* li.commit', | |
| avatar_url: ['css img.gravatar', 'xpath string(@src)'] | |
| author_name: 'xpath string(.//*[@class="author-name"])' | |
| ] | |
| ready: (dom) -> | |
| The mandatory/optional selector rules defined above behave as you'd expect as | |
| used for context selectors too: a mandatory node or array of nodes will limit | |
| what pages your script gets called on to those that match it, so your code is | |
| free to assume it will always be there when it runs. An optional context node | |
| that is not found will instead result in that part of your DOM being null, or | |
| an empty array, in the case of a * selector. | |
| Finally, there is the xpath! keyword, which is similar to xpath, but it also | |
| mandates that whatever is returned is truthy. This is useful when you use the | |
| xpath functions returning strings, numbers and of course booleans, to assert | |
| things about the pages you want to run on, like 'xpath! count(//img) = 0', if | |
| you never want the script to run on pages with inline images, say. | |
| Once you called given(), you may call given.dom to do page scraping later on, | |
| returning whatever matched your selector(s) passed. Mandatory selectors which | |
| failed to match at this point will return undefined, optional selectors null: | |
| given.dom('xpath //a[@id]') => undefined or <a id="..."> | |
| given.dom('xpath? //a[@id]') => null or <a id="..."> | |
| given.dom('xpath+ //a[@id]') => undefined or [<a id="...">, <a id>, ...] | |
| given.dom('xpath* //a[@id]') => [] or [<a id="...">, <a id>, ...] | |
| To detect a failed mandatory match, you can use given.dom(...) === given.FAIL | |
| Github pjax hook: to re-run the script's given() block for every pjax request | |
| to a site - add a pushstate hook as per http://goo.gl/LNSv1 -- and be sure to | |
| make your script reentrant, so that it won't try to process the same elements | |
| again, if they are still sitting around in the page (see ':not([augmented])') | |
| */ | |
| function given(opts, plugins) { | |
| var Object_toString = Object.prototype.toString | |
| , Array_slice = Array.prototype.slice | |
| , FAIL = 'dom' in given ? undefined : (function() { | |
| var tests = | |
| { path_re: { fn: test_regexp } | |
| , query: { fn: test_query } | |
| , dom: { fn: test_dom | |
| , my: { 'css*': $c | |
| , 'css+': one_or_more($c) | |
| , 'css?': $C | |
| , 'css': not_null($C) | |
| , 'xpath*': $x | |
| , 'xpath+': one_or_more($x) | |
| , 'xpath?': $X | |
| , 'xpath!': truthy($x) | |
| , 'xpath': not_null($X) | |
| } | |
| } | |
| , inject: { fn: inject } | |
| } | |
| , name, test, me, my, mine | |
| ; | |
| for (name in tests) { | |
| test = tests[name]; | |
| me = test.fn; | |
| if ((my = test.my)) | |
| for (mine in my) | |
| me[mine] = my[mine]; | |
| given[name] = me; | |
| } | |
| })() | |
| , input = [] // args for the callback(s?) the script wants to run | |
| , rules = Object.create(opts) // wraps opts in a pokeable inherit layer | |
| , debug = get('debug') | |
| , script = get('name') | |
| , ready = get('ready') | |
| , load = get('load') | |
| , pushState = get('pushstate') | |
| , pjax_event = get('pjaxevent') | |
| , name, rule, test, result, retry, plugin | |
| ; | |
| if (typeof ready !== 'function' && | |
| typeof load !== 'function' && | |
| typeof pushState !== 'function') { | |
| alert('no given function'); | |
| throw new Error('given() needs at least a "ready" or "load" function!'); | |
| } | |
| if (plugins) | |
| for (name in plugins) | |
| if ((rule = plugins[name]) && (test = given[name])) | |
| for (plugin in rule) | |
| if (!(test[plugin])) { | |
| given._parse_dom_rule = null; | |
| test[plugin] = rule[plugin]; | |
| } | |
| if (pushState && history.pushState && | |
| (given.pushState = given.pushState || []).indexOf(opts) === -1) { | |
| given.pushState.push(opts); // make sure we don't reregister post-navigation | |
| initPushState(pushState, pjax_event); | |
| } | |
| try { | |
| for (name in rules) { | |
| rule = rules[name]; | |
| if (rule === undefined) continue; // was some callback or other non-rule | |
| test = given[name]; | |
| if (!test) throw new Error('did not grok rule "'+ name +'"!'); | |
| result = test(rule); | |
| if (result === FAIL) return false; // the page doesn't satisfy all rules | |
| input.push(result); | |
| } | |
| } | |
| catch(e) { | |
| if (debug) console.warn("given(debug): we didn't run because " + e.message); | |
| return false; | |
| } | |
| if (ready) { | |
| ready.apply(opts, input.concat()); | |
| } | |
| if (load) window.addEventListener('load', function() { | |
| load.apply(opts, input.concat()); | |
| }); | |
| return input.concat(opts); | |
| function get(x) { rules[x] = undefined; return opts[x]; } | |
| function isArray(x) { return Object_toString.call(x) === '[object Array]'; } | |
| function isObject(x) { return Object_toString.call(x) === '[object Object]'; } | |
| function array(a) { return Array_slice.call(a, 0); } // array:ish => Array | |
| function arrayify(x) { return isArray(x) ? x : [x]; } // non-array? => Array | |
| function inject(fn, args) { | |
| var script = document.createElement('script') | |
| , parent = document.documentElement; | |
| args = JSON.stringify(args || []).slice(1, -1); | |
| script.textContent = '('+ fn +')('+ args +');'; | |
| parent.appendChild(script); | |
| parent.removeChild(script); | |
| } | |
| function initPushState(callback, pjax_event) { | |
| if (!history.pushState.armed) { | |
| inject(function(pjax_event) { | |
| function reportBack() { | |
| var e = document.createEvent('Events'); | |
| e.initEvent('history.pushState', !'bubbles', !'cancelable'); | |
| document.dispatchEvent(e); | |
| } | |
| var pushState = history.pushState; | |
| history.pushState = function given_pushState() { | |
| if (pjax_event && window.$ && $.pjax) | |
| $(document).one(pjax_event, reportBack); | |
| else | |
| setTimeout(reportBack, 0); | |
| return pushState.apply(this, arguments); | |
| }; | |
| }, [pjax_event]); | |
| history.pushState.armed = pjax_event; | |
| } | |
| retry = function after_pushState() { | |
| rules = Object.create(opts); | |
| rules.load = rules.pushstate = undefined; | |
| rules.ready = callback; | |
| given(rules); | |
| }; | |
| document.addEventListener('history.pushState', function() { | |
| if (debug) console.log('given.pushstate', location.pathname); | |
| retry(); | |
| }, false); | |
| } | |
| function test_query(spec) { | |
| var q = unparam(this === given || this === window ? location.search : this); | |
| if (spec === true || spec == null) return q; // decode the query for me! | |
| throw new Error('bad query type '+ (typeof spec) +': '+ spec); | |
| } | |
| function unparam(query) { | |
| var data = {}; | |
| (query || '').replace(/\+/g, '%20').split('&').forEach(function(kv) { | |
| kv = /^\??([^=&]*)(?:=(.*))?/.exec(kv); | |
| if (!kv) return; | |
| var prop, val, k = kv[1], v = kv[2], e, m; | |
| try { prop = decodeURIComponent(k); } catch (e) { prop = unescape(k); } | |
| if ((val = v) != null) | |
| try { val = decodeURIComponent(v); } catch (e) { val = unescape(v); } | |
| data[prop] = val; | |
| }); | |
| return data; | |
| } | |
| function test_regexp(spec) { | |
| if (!isArray(spec)) spec = arrayify(spec); | |
| var re = spec.shift(); | |
| if (typeof re === 'string') re = new RegExp(re); | |
| if (!(re instanceof RegExp)) | |
| throw new Error((typeof re) +' was not a regexp: '+ re); | |
| var ok = re.exec(this===given || this===window ? location.pathname : this); | |
| if (ok === null) return FAIL; | |
| if (!spec.length) return ok; | |
| var named = {}; | |
| ok.shift(); // drop matching-whole-regexp part | |
| while (spec.length) named[spec.shift()] = ok.shift(); | |
| return named; | |
| } | |
| function truthy(fn) { return function(s) { | |
| var x = fn.apply(this, arguments); return x || FAIL; | |
| }; } | |
| function not_null(fn) { return function(s) { | |
| var x = fn.apply(this, arguments); return x !== null ? x : FAIL; | |
| }; } | |
| function one_or_more(fn) { return function(s) { | |
| var x = fn.apply(this, arguments); return x.length ? x : FAIL; | |
| }; } | |
| function $c(css) { return array(this.querySelectorAll(css)); } | |
| function $C(css) { return this.querySelector(css); } | |
| function $x(xpath) { | |
| var doc = this.evaluate ? this : this.ownerDocument, next; | |
| var got = doc.evaluate(xpath, this, null, 0, null), all = []; | |
| switch (got.resultType) { | |
| case 1/*XPathResult.NUMBER_TYPE*/: return got.numberValue; | |
| case 2/*XPathResult.STRING_TYPE*/: return got.stringValue; | |
| case 3/*XPathResult.BOOLEAN_TYPE*/: return got.booleanValue; | |
| default: while ((next = got.iterateNext())) all.push(next); return all; | |
| } | |
| } | |
| function $X(xpath) { | |
| var got = $x.call(this, xpath); | |
| return got instanceof Array ? got[0] || null : got; | |
| } | |
| function quoteRe(s) { return (s+'').replace(/([-$(-+.?[-^{|}])/g, '\\$1'); } | |
| // DOM constraint tester / scraper facility: | |
| // "this" is the context Node(s) - initially the document | |
| // "spec" is either of: | |
| // * css / xpath Selector "selector_type selector" | |
| // * resolved for context [ context Selector, spec ] | |
| // * an Object of spec(s) { property_name: spec, ... } | |
| function test_dom(spec, context) { | |
| // returns FAIL if it turned out it wasn't a mandated match at this level | |
| // returns null if it didn't find optional matches at this level | |
| // returns Node or an Array of nodes, or a basic type from some XPath query | |
| function lookup(rule) { | |
| switch (typeof rule) { | |
| case 'string': break; // main case - rest of function | |
| case 'object': if ('nodeType' in rule || rule.length) return rule; | |
| // fall-through | |
| default: throw new Error('non-String dom match rule: '+ rule); | |
| } | |
| if (!given._parse_dom_rule) given._parse_dom_rule = new RegExp('^(' + | |
| Object.keys(given.dom).map(quoteRe).join('|') + ')\\s*(.*)'); | |
| var match = given._parse_dom_rule.exec(rule), type, func; | |
| if (match) { | |
| type = match[1]; | |
| rule = match[2]; | |
| func = test_dom[type]; | |
| } | |
| if (!func) throw new Error('unknown dom match rule '+ type +': '+ rule); | |
| return func.call(this, rule); | |
| } | |
| var results, result, i, property_name; | |
| if (context === undefined) { | |
| context = this === given || this === window ? document : this; | |
| } | |
| // validate context: | |
| if (context === null || context === FAIL) return FAIL; | |
| if (isArray(context)) { | |
| for (results = [], i = 0; i < context.length; i++) { | |
| result = test_dom.call(context[i], spec); | |
| if (result !== FAIL) | |
| results.push(result); | |
| } | |
| return results; | |
| } | |
| if (typeof context !== 'object' || !('nodeType' in context)) | |
| throw new Error('illegal context: '+ context); | |
| // handle input spec format: | |
| if (typeof spec === 'string') return lookup.call(context, spec); | |
| if (isArray(spec)) { | |
| context = lookup.call(context, spec[0]); | |
| if (context === null || context === FAIL) return context; | |
| return test_dom.call(context, spec[1]); | |
| } | |
| if (isObject(spec)) { | |
| results = {}; | |
| for (property_name in spec) { | |
| result = test_dom.call(context, spec[property_name]); | |
| if (result === FAIL) return FAIL; | |
| results[property_name] = result; | |
| } | |
| return results; | |
| } | |
| throw new Error("dom spec was neither a String, Object nor Array: "+ spec); | |
| } | |
| }; | |
| if ('module' in this) module.exports = given; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <title>Code coverage report for ./given.js</title> | |
| <meta charset="utf-8"> | |
| <link rel="stylesheet" href="../prettify.css"> | |
| <style> | |
| body, html { | |
| margin:0; padding: 0; | |
| } | |
| body { | |
| font-family: Helvetica Neue, Helvetica,Arial; | |
| font-size: 10pt; | |
| } | |
| div.header, div.footer { | |
| background: #eee; | |
| padding: 1em; | |
| } | |
| div.header { | |
| z-index: 100; | |
| position: fixed; | |
| top: 0; | |
| border-bottom: 1px solid #666; | |
| width: 100%; | |
| } | |
| div.footer { | |
| border-top: 1px solid #666; | |
| } | |
| div.body { | |
| margin-top: 10em; | |
| } | |
| div.meta { | |
| font-size: 90%; | |
| text-align: center; | |
| } | |
| h1, h2, h3 { | |
| font-weight: normal; | |
| } | |
| h1 { | |
| font-size: 12pt; | |
| } | |
| h2 { | |
| font-size: 10pt; | |
| } | |
| pre { | |
| font-family: Consolas, Menlo, Monaco, monospace; | |
| margin: 0; | |
| padding: 0; | |
| line-height: 14px; | |
| font-size: 14px; | |
| -moz-tab-size: 2; | |
| -o-tab-size: 2; | |
| tab-size: 2; | |
| } | |
| div.path { font-size: 110%; } | |
| div.path a:link, div.path a:visited { color: #000; } | |
| table.coverage { border-collapse: collapse; margin:0; padding: 0 } | |
| table.coverage td { | |
| margin: 0; | |
| padding: 0; | |
| color: #111; | |
| vertical-align: top; | |
| } | |
| table.coverage td.line-count { | |
| width: 50px; | |
| text-align: right; | |
| padding-right: 5px; | |
| } | |
| table.coverage td.line-coverage { | |
| color: #777 !important; | |
| text-align: right; | |
| border-left: 1px solid #666; | |
| border-right: 1px solid #666; | |
| } | |
| table.coverage td.text { | |
| } | |
| table.coverage td span.cline-any { | |
| display: inline-block; | |
| padding: 0 5px; | |
| width: 40px; | |
| } | |
| table.coverage td span.cline-neutral { | |
| background: #eee; | |
| } | |
| table.coverage td span.cline-yes { | |
| background: #b5d592; | |
| color: #999; | |
| } | |
| table.coverage td span.cline-no { | |
| background: #fc8c84; | |
| } | |
| .cstat-yes { color: #111; } | |
| .cstat-no { background: #fc8c84; color: #111; } | |
| .fstat-no { background: #ffc520; color: #111 !important; } | |
| .cbranch-no { background: yellow !important; color: #111; } | |
| .missing-if-branch { | |
| display: inline-block; | |
| margin-right: 10px; | |
| position: relative; | |
| padding: 0 4px; | |
| background: black; | |
| color: yellow; | |
| xtext-decoration: line-through; | |
| } | |
| .missing-if-branch .typ { | |
| color: inherit !important; | |
| } | |
| .entity, .metric { font-weight: bold; } | |
| .metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; } | |
| .metric small { font-size: 80%; font-weight: normal; color: #666; } | |
| div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; } | |
| div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; } | |
| div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; } | |
| div.coverage-summary th.file { border-right: none !important; } | |
| div.coverage-summary th.pic { border-left: none !important; text-align: right; } | |
| div.coverage-summary th.pct { border-right: none !important; } | |
| div.coverage-summary th.abs { border-left: none !important; text-align: right; } | |
| div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; } | |
| div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; } | |
| div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap; } | |
| div.coverage-summary td.pic { min-width: 120px !important; } | |
| div.coverage-summary a:link { text-decoration: none; color: #000; } | |
| div.coverage-summary a:visited { text-decoration: none; color: #333; } | |
| div.coverage-summary a:hover { text-decoration: underline; } | |
| div.coverage-summary tfoot td { border-top: 1px solid #666; } | |
| div.coverage-summary .yui3-datatable-sort-indicator, div.coverage-summary .dummy-sort-indicator { | |
| height: 10px; | |
| width: 7px; | |
| display: inline-block; | |
| margin-left: 0.5em; | |
| } | |
| div.coverage-summary .yui3-datatable-sort-indicator { | |
| background: url("http://yui.yahooapis.com/3.6.0/build/datatable-sort/assets/skins/sam/sort-arrow-sprite.png") no-repeat scroll 0 0 transparent; | |
| } | |
| div.coverage-summary .yui3-datatable-sorted .yui3-datatable-sort-indicator { | |
| background-position: 0 -20px; | |
| } | |
| div.coverage-summary .yui3-datatable-sorted-desc .yui3-datatable-sort-indicator { | |
| background-position: 0 -10px; | |
| } | |
| .high { background: #b5d592 !important; } | |
| .medium { background: #ffe87c !important; } | |
| .low { background: #fc8c84 !important; } | |
| span.cover-fill, span.cover-empty { | |
| display:inline-block; | |
| border:1px solid #444; | |
| background: white; | |
| height: 12px; | |
| } | |
| span.cover-fill { | |
| background: #ccc; | |
| border-right: 1px solid #444; | |
| } | |
| span.cover-empty { | |
| background: white; | |
| border-left: none; | |
| } | |
| span.cover-full { | |
| border-right: none !important; | |
| } | |
| pre.prettyprint { | |
| border: none !important; | |
| padding: 0 !important; | |
| margin: 0 !important; | |
| } | |
| .com { color: #999 !important; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="header medium"> | |
| <h1>Code coverage report for <span class="entity">./given.js</span></h1> | |
| <h2> | |
| Statements: <span class="metric">73.76% <small>(149 / 202)</small></span> | |
| Branches: <span class="metric">66.67% <small>(92 / 138)</small></span> | |
| Functions: <span class="metric">75% <small>(24 / 32)</small></span> | |
| Lines: <span class="metric">75% <small>(120 / 160)</small></span> | |
| </h2> | |
| <div class="path"><a href="../index.html">All files</a> » <a href="index.html">./</a> » given.js</div> | |
| </div> | |
| <div class="body"> | |
| <pre><table class="coverage"> | |
| <tr><td class="line-count">1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
| 300 | |
| 301 | |
| 302 | |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | |
| 308 | |
| 309 | |
| 310 | |
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | |
| 338 | |
| 339 | |
| 340 | |
| 341 | |
| 342 | |
| 343 | |
| 344 | |
| 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | |
| 351 | |
| 352 | |
| 353 | |
| 354 | |
| 355 | |
| 356 | |
| 357 | |
| 358 | |
| 359 | |
| 360 | |
| 361 | |
| 362 | |
| 363 | |
| 364 | |
| 365 | |
| 366 | |
| 367 | |
| 368 | |
| 369 | |
| 370 | |
| 371 | |
| 372 | |
| 373 | |
| 374 | |
| 375 | |
| 376 | |
| 377 | |
| 378 | |
| 379 | |
| 380 | |
| 381</td><td class="line-coverage"><span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">7</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">4</span> | |
| <span class="cline-any cline-yes">4</span> | |
| <span class="cline-any cline-yes">4</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">9</span> | |
| <span class="cline-any cline-yes">4</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-yes">16</span> | |
| <span class="cline-any cline-yes">16</span> | |
| <span class="cline-any cline-yes">4</span> | |
| <span class="cline-any cline-yes">4</span> | |
| <span class="cline-any cline-yes">4</span> | |
| <span class="cline-any cline-yes">4</span> | |
| <span class="cline-any cline-yes">4</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">12</span> | |
| <span class="cline-any cline-yes">105</span> | |
| <span class="cline-any cline-yes">13</span> | |
| <span class="cline-any cline-yes">10</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">5</span> | |
| <span class="cline-any cline-yes">5</span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">5</span> | |
| <span class="cline-any cline-yes">5</span> | |
| <span class="cline-any cline-yes">6</span> | |
| <span class="cline-any cline-yes">6</span> | |
| <span class="cline-any cline-yes">6</span> | |
| <span class="cline-any cline-yes">6</span> | |
| <span class="cline-any cline-yes">6</span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-yes">6</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">5</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">9</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-yes">32</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-yes">6</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">10</span> | |
| <span class="cline-any cline-yes">13</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">39</span> | |
| <span class="cline-any cline-yes">39</span> | |
| <span class="cline-any cline-yes">39</span> | |
| <span class="cline-any cline-yes">7</span> | |
| <span class="cline-any cline-yes">11</span> | |
| <span class="cline-any cline-yes">5</span> | |
| <span class="cline-any cline-yes">16</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">26</span> | |
| <span class="cline-any cline-yes">26</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">19</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-yes">67</span> | |
| <span class="cline-any cline-yes">65</span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">65</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">65</span> | |
| <span class="cline-any cline-yes">65</span> | |
| <span class="cline-any cline-yes">65</span> | |
| <span class="cline-any cline-yes">65</span> | |
| <span class="cline-any cline-yes">65</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">65</span> | |
| <span class="cline-any cline-yes">65</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">82</span> | |
| <span class="cline-any cline-yes">82</span> | |
| <span class="cline-any cline-yes">82</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">82</span> | |
| <span class="cline-any cline-yes">82</span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-yes">7</span> | |
| <span class="cline-any cline-yes">7</span> | |
| <span class="cline-any cline-yes">7</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">2</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">80</span> | |
| <span class="cline-any cline-no"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">80</span> | |
| <span class="cline-any cline-yes">21</span> | |
| <span class="cline-any cline-yes">8</span> | |
| <span class="cline-any cline-yes">8</span> | |
| <span class="cline-any cline-yes">7</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">13</span> | |
| <span class="cline-any cline-yes">12</span> | |
| <span class="cline-any cline-yes">12</span> | |
| <span class="cline-any cline-yes">14</span> | |
| <span class="cline-any cline-yes">14</span> | |
| <span class="cline-any cline-yes">11</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">9</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-neutral"> </span> | |
| <span class="cline-any cline-yes">1</span> | |
| <span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/* coffee-script example usage - at https://github.com/johan/dotjs/commits/johan | |
| | |
| given path_re: ['^/([^/]+)/([^/]+)(/?.*)', 'user', 'repo', 'rest'] | |
| query: true | |
| dom: | |
| keyboard: 'css .keyboard-shortcuts' | |
| branches: 'css+ .js-filter-branches h4 a' | |
| dates: 'css* .commit-group-heading' | |
| tracker: 'css? #gauges-tracker[defer]' | |
| johan_ci: 'xpath* //li[contains(@class,"commit")][.//a[.="johan"]]' | |
| ready: (path, query, dom) -> | |
| | |
| ...would make something like this call, as the path regexp matched, and there | |
| were DOM matches for the two mandatory "keyboard" and "branches" selectors: | |
| | |
| ready( { user: 'johan', repo: 'dotjs', rest: '/commits/johan' } | |
| , {} // would contain all query args (if any were present) | |
| , { keyboard: Node<a href="#keyboard_shortcuts_pane"> | |
| , branches: [ Node<a href="/johan/dotjs/commits/coffee"> | |
| , Node<a href="/johan/dotjs/commits/dirs"> | |
| , Node<a href="/johan/dotjs/commits/gh-pages"> | |
| , Node<a href="/johan/dotjs/commits/johan"> | |
| , Node<a href="/johan/dotjs/commits/jquery-1.8.2"> | |
| , Node<a href="/johan/dotjs/commits/master"> | |
| ] | |
| , dates: [ Node<h3 class="commit-group-heading">Oct 07, 2012</h3> | |
| , Node<h3 class="commit-group-heading">Aug 29, 2012</h3> | |
| , ... | |
| ] | |
| , tracker: null | |
| , johan_ci: [ Node<li class="commit">, ... ] | |
| } | |
| ) | |
| | |
| A selector returns an array of matches prefixed for "css*" and "css+" (ditto | |
| xpath), and a single result if it is prefixed "css" or "css?": | |
| | |
| If your script should only run on pages with a particular DOM node (or set of | |
| nodes), use the 'css' or 'css+' (ditto xpath) forms - and your callback won't | |
| get fired on pages that lack them. The 'css?' and 'css*' forms would run your | |
| callback but pass null or [] respectively, on not finding such nodes. You may | |
| recognize the semantics of x, x?, x* and x+ from regular expressions. | |
| | |
| (see http://goo.gl/ejtMD for a more thorough discussion of something similar) | |
| | |
| The dom property is recursively defined so you can make nested structures. | |
| If you want a property that itself is an object full of matched things, pass | |
| an object of sub-dom-spec:s, instead of a string selector: | |
| | |
| given dom: | |
| meta: | |
| base: 'xpath? /head/base | |
| title: 'xpath string(/head/title)' | |
| commits: 'css* li.commit' | |
| ready: (dom) -> | |
| | |
| You can also deconstruct repeated templated sections of a page into subarrays | |
| scraped as per your specs, by picking a context node for a dom spec. This is | |
| done by passing a two-element array: a selector resolving what node/nodes you | |
| look at and a dom spec describing how you want it/them deconstructed for you: | |
| | |
| given dom: | |
| meta: | |
| [ 'xpath /head', | |
| base: 'xpath? base | |
| title: 'xpath string(title)' | |
| ] | |
| commits: | |
| [ 'css* li.commit', | |
| avatar_url: ['css img.gravatar', 'xpath string(@src)'] | |
| author_name: 'xpath string(.//*[@class="author-name"])' | |
| ] | |
| ready: (dom) -> | |
| | |
| The mandatory/optional selector rules defined above behave as you'd expect as | |
| used for context selectors too: a mandatory node or array of nodes will limit | |
| what pages your script gets called on to those that match it, so your code is | |
| free to assume it will always be there when it runs. An optional context node | |
| that is not found will instead result in that part of your DOM being null, or | |
| an empty array, in the case of a * selector. | |
| | |
| Finally, there is the xpath! keyword, which is similar to xpath, but it also | |
| mandates that whatever is returned is truthy. This is useful when you use the | |
| xpath functions returning strings, numbers and of course booleans, to assert | |
| things about the pages you want to run on, like 'xpath! count(//img) = 0', if | |
| you never want the script to run on pages with inline images, say. | |
| | |
| Once you called given(), you may call given.dom to do page scraping later on, | |
| returning whatever matched your selector(s) passed. Mandatory selectors which | |
| failed to match at this point will return undefined, optional selectors null: | |
| | |
| given.dom('xpath //a[@id]') => undefined or <a id="..."> | |
| given.dom('xpath? //a[@id]') => null or <a id="..."> | |
| given.dom('xpath+ //a[@id]') => undefined or [<a id="...">, <a id>, ...] | |
| given.dom('xpath* //a[@id]') => [] or [<a id="...">, <a id>, ...] | |
| | |
| To detect a failed mandatory match, you can use given.dom(...) === given.FAIL | |
| | |
| Github pjax hook: to re-run the script's given() block for every pjax request | |
| to a site - add a pushstate hook as per http://goo.gl/LNSv1 -- and be sure to | |
| make your script reentrant, so that it won't try to process the same elements | |
| again, if they are still sitting around in the page (see ':not([augmented])') | |
| | |
| */ | |
| | |
| function given(opts, plugins) { | |
| var Object_toString = Object.prototype.toString | |
| , Array_slice = Array.prototype.slice | |
| , FAIL = 'dom' in given ? undefined : (function() { | |
| var tests = | |
| { path_re: { fn: test_regexp } | |
| , query: { fn: test_query } | |
| , dom: { fn: test_dom | |
| , my: { 'css*': $c | |
| , 'css+': one_or_more($c) | |
| , 'css?': $C | |
| , 'css': not_null($C) | |
| , 'xpath*': $x | |
| , 'xpath+': one_or_more($x) | |
| , 'xpath?': $X | |
| , 'xpath!': truthy($x) | |
| , 'xpath': not_null($X) | |
| } | |
| } | |
| , inject: { fn: inject } | |
| } | |
| , name, test, me, my, mine | |
| ; | |
| | |
| for (name in tests) { | |
| test = tests[name]; | |
| me = test.fn; | |
| if ((my = test.my)) | |
| for (mine in my) | |
| me[mine] = my[mine]; | |
| given[name] = me; | |
| } | |
| })() | |
| | |
| , input = [] // args for the callback(s?) the script wants to run | |
| , rules = Object.create(opts) // wraps opts in a pokeable inherit layer | |
| , debug = get('debug') | |
| , script = get('name') | |
| , ready = get('ready') | |
| , load = get('load') | |
| , pushState = get('pushstate') | |
| , pjax_event = get('pjaxevent') | |
| , name, rule, test, result, retry, plugin | |
| ; | |
| | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if (typeof ready !== 'function' && | |
| <span class="branch-1 cbranch-no" title="branch not covered" > typeof load !== 'function' </span>&& | |
| <span class="branch-2 cbranch-no" title="branch not covered" > typeof pushState !== 'function')</span> { | |
| <span class="cstat-no" title="statement not covered" > alert('no given function');</span> | |
| <span class="cstat-no" title="statement not covered" > throw new Error('given() needs at least a "ready" or "load" function!');</span> | |
| } | |
| | |
| if (plugins) | |
| for (name in plugins) | |
| <span class="missing-if-branch" title="else path not taken"" >E</span>if ((rule = plugins[name]) && (test = given[name])) | |
| for (plugin in rule) | |
| <span class="missing-if-branch" title="else path not taken"" >E</span>if (!(test[plugin])) { | |
| given._parse_dom_rule = null; | |
| test[plugin] = rule[plugin]; | |
| } | |
| | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if (pushState && <span class="branch-1 cbranch-no" title="branch not covered" >history.pushState </span>&& | |
| <span class="branch-2 cbranch-no" title="branch not covered" > (given.pushState = given.pushState || []).indexOf(opts) === -1)</span> { | |
| <span class="cstat-no" title="statement not covered" > given.pushState.push(opts); </span>// make sure we don't reregister post-navigation | |
| <span class="cstat-no" title="statement not covered" > initPushState(pushState, pjax_event);</span> | |
| } | |
| | |
| try { | |
| for (name in rules) { | |
| rule = rules[name]; | |
| if (rule === undefined) continue; // was some callback or other non-rule | |
| test = given[name]; | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if (!test) <span class="cstat-no" title="statement not covered" >throw new Error('did not grok rule "'+ name +'"!');</span> | |
| result = test(rule); | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if (result === FAIL) <span class="cstat-no" title="statement not covered" >return false; </span>// the page doesn't satisfy all rules | |
| input.push(result); | |
| } | |
| } | |
| catch(e) { | |
| <span class="cstat-no" title="statement not covered" > if (debug) <span class="cstat-no" title="statement not covered" >console.warn("given(debug): we didn't run because " + e.message);</span></span> | |
| <span class="cstat-no" title="statement not covered" > return false;</span> | |
| } | |
| | |
| <span class="missing-if-branch" title="else path not taken"" >E</span>if (ready) { | |
| ready.apply(opts, input.concat()); | |
| } | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if (load) <span class="cstat-no" title="statement not covered" >window.addEventListener('load', <span class="fstat-no" title="function not covered" >function() {</span></span> | |
| <span class="cstat-no" title="statement not covered" > load.apply(opts, input.concat());</span> | |
| }); | |
| return input.concat(opts); | |
| | |
| function get(x) { rules[x] = undefined; return opts[x]; } | |
| function isArray(x) { return Object_toString.call(x) === '[object Array]'; } | |
| function isObject(x) { return Object_toString.call(x) === '[object Object]'; } | |
| function array(a) { return Array_slice.call(a, 0); } // array:ish => Array | |
| function arrayify(x) { return isArray(x) ? <span class="branch-0 cbranch-no" title="branch not covered" >x </span>: [x]; } // non-array? => Array | |
| <span class="fstat-no" title="function not covered" > function inject(fn, args) {</span> | |
| <span class="cstat-no" title="statement not covered" > var script = document.createElement('script')</span> | |
| , parent = document.documentElement; | |
| <span class="cstat-no" title="statement not covered" > args = JSON.stringify(args || []).slice(1, -1);</span> | |
| <span class="cstat-no" title="statement not covered" > script.textContent = '('+ fn +')('+ args +');';</span> | |
| <span class="cstat-no" title="statement not covered" > parent.appendChild(script);</span> | |
| <span class="cstat-no" title="statement not covered" > parent.removeChild(script);</span> | |
| } | |
| | |
| <span class="fstat-no" title="function not covered" > function initPushState(callback, pjax_event) {</span> | |
| <span class="cstat-no" title="statement not covered" > if (!history.pushState.armed) {</span> | |
| <span class="cstat-no" title="statement not covered" > inject(<span class="fstat-no" title="function not covered" >function(pjax_event) {</span></span> | |
| <span class="fstat-no" title="function not covered" > function reportBack() {</span> | |
| <span class="cstat-no" title="statement not covered" > var e = document.createEvent('Events');</span> | |
| <span class="cstat-no" title="statement not covered" > e.initEvent('history.pushState', !'bubbles', !'cancelable');</span> | |
| <span class="cstat-no" title="statement not covered" > document.dispatchEvent(e);</span> | |
| } | |
| <span class="cstat-no" title="statement not covered" > var pushState = history.pushState;</span> | |
| <span class="cstat-no" title="statement not covered" > history.pushState = <span class="fstat-no" title="function not covered" >function given_pushState() {</span></span> | |
| <span class="cstat-no" title="statement not covered" > if (pjax_event && window.$ && $.pjax)</span> | |
| <span class="cstat-no" title="statement not covered" > $(document).one(pjax_event, reportBack);</span> | |
| else | |
| <span class="cstat-no" title="statement not covered" > setTimeout(reportBack, 0);</span> | |
| <span class="cstat-no" title="statement not covered" > return pushState.apply(this, arguments);</span> | |
| }; | |
| }, [pjax_event]); | |
| <span class="cstat-no" title="statement not covered" > history.pushState.armed = pjax_event;</span> | |
| } | |
| | |
| <span class="cstat-no" title="statement not covered" > retry = <span class="fstat-no" title="function not covered" >function after_pushState() {</span></span> | |
| <span class="cstat-no" title="statement not covered" > rules = Object.create(opts);</span> | |
| <span class="cstat-no" title="statement not covered" > rules.load = rules.pushstate = undefined;</span> | |
| <span class="cstat-no" title="statement not covered" > rules.ready = callback;</span> | |
| <span class="cstat-no" title="statement not covered" > given(rules);</span> | |
| }; | |
| | |
| <span class="cstat-no" title="statement not covered" > document.addEventListener('history.pushState', <span class="fstat-no" title="function not covered" >function() {</span></span> | |
| <span class="cstat-no" title="statement not covered" > if (debug) <span class="cstat-no" title="statement not covered" >console.log('given.pushstate', location.pathname);</span></span> | |
| <span class="cstat-no" title="statement not covered" > retry();</span> | |
| }, false); | |
| } | |
| | |
| function test_query(spec) { | |
| var q = unparam(this === given || this === window ? location.search : <span class="branch-1 cbranch-no" title="branch not covered" >this)</span>; | |
| <span class="missing-if-branch" title="else path not taken"" >E</span>if (spec === true || spec == null) return q; // decode the query for me! | |
| <span class="cstat-no" title="statement not covered" > throw new Error('bad query type '+ (typeof spec) +': '+ spec);</span> | |
| } | |
| | |
| function unparam(query) { | |
| var data = {}; | |
| (query || '').replace(/\+/g, '%20').split('&').forEach(function(kv) { | |
| kv = /^\??([^=&]*)(?:=(.*))?/.exec(kv); | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if (!kv) <span class="cstat-no" title="statement not covered" >return;</span> | |
| var prop, val, k = kv[1], v = kv[2], e, m; | |
| try { prop = decodeURIComponent(k); } catch (e) { <span class="cstat-no" title="statement not covered" >prop = unescape(k); </span>} | |
| if ((val = v) != null) | |
| try { val = decodeURIComponent(v); } catch (e) { <span class="cstat-no" title="statement not covered" >val = unescape(v); </span>} | |
| data[prop] = val; | |
| }); | |
| return data; | |
| } | |
| | |
| function test_regexp(spec) { | |
| <span class="missing-if-branch" title="else path not taken"" >E</span>if (!isArray(spec)) spec = arrayify(spec); | |
| var re = spec.shift(); | |
| <span class="missing-if-branch" title="else path not taken"" >E</span>if (typeof re === 'string') re = new RegExp(re); | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if (!(re instanceof RegExp)) | |
| <span class="cstat-no" title="statement not covered" > throw new Error((typeof re) +' was not a regexp: '+ re);</span> | |
| | |
| var ok = re.exec(this===given || this===window ? location.pathname : <span class="branch-1 cbranch-no" title="branch not covered" >this)</span>; | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if (ok === null) <span class="cstat-no" title="statement not covered" >return FAIL;</span> | |
| <span class="missing-if-branch" title="else path not taken"" >E</span>if (!spec.length) return ok; | |
| <span class="cstat-no" title="statement not covered" > var named = {};</span> | |
| <span class="cstat-no" title="statement not covered" > ok.shift(); </span>// drop matching-whole-regexp part | |
| <span class="cstat-no" title="statement not covered" > while (spec.length) <span class="cstat-no" title="statement not covered" >named[spec.shift()] = ok.shift();</span></span> | |
| <span class="cstat-no" title="statement not covered" > return named;</span> | |
| } | |
| | |
| function truthy(fn) { return function(s) { | |
| var x = fn.apply(this, arguments); return x || FAIL; | |
| }; } | |
| | |
| function not_null(fn) { return function(s) { | |
| var x = fn.apply(this, arguments); return x !== null ? x : FAIL; | |
| }; } | |
| | |
| function one_or_more(fn) { return function(s) { | |
| var x = fn.apply(this, arguments); return x.length ? x : FAIL; | |
| }; } | |
| | |
| function $c(css) { return array(this.querySelectorAll(css)); } | |
| function $C(css) { return this.querySelector(css); } | |
| | |
| function $x(xpath) { | |
| var doc = this.evaluate ? this : this.ownerDocument, next; | |
| var got = doc.evaluate(xpath, this, null, 0, null), all = []; | |
| switch (got.resultType) { | |
| case 1/*XPathResult.NUMBER_TYPE*/: return got.numberValue; | |
| case 2/*XPathResult.STRING_TYPE*/: return got.stringValue; | |
| case 3/*XPathResult.BOOLEAN_TYPE*/: return got.booleanValue; | |
| default: while ((next = got.iterateNext())) all.push(next); return all; | |
| } | |
| } | |
| function $X(xpath) { | |
| var got = $x.call(this, xpath); | |
| return got instanceof Array ? got[0] || null : got; | |
| } | |
| | |
| function quoteRe(s) { return (s+'').replace(/([-$(-+.?[-^{|}])/g, '\\$1'); } | |
| | |
| // DOM constraint tester / scraper facility: | |
| // "this" is the context Node(s) - initially the document | |
| // "spec" is either of: | |
| // * css / xpath Selector "selector_type selector" | |
| // * resolved for context [ context Selector, spec ] | |
| // * an Object of spec(s) { property_name: spec, ... } | |
| function test_dom(spec, context) { | |
| // returns FAIL if it turned out it wasn't a mandated match at this level | |
| // returns null if it didn't find optional matches at this level | |
| // returns Node or an Array of nodes, or a basic type from some XPath query | |
| function lookup(rule) { | |
| switch (typeof rule) { | |
| case 'string': break; // main case - rest of function | |
| case 'object': <span class="missing-if-branch" title="else path not taken"" >E</span>if ('nodeType' in rule || rule.length) return rule; | |
| // fall-through | |
| <span class="branch-2 cbranch-no" title="branch not covered" > default: <span class="cstat-no" title="statement not covered" >throw new Error('non-String dom match rule: '+ rule);</span></span> | |
| } | |
| if (!given._parse_dom_rule) given._parse_dom_rule = new RegExp('^(' + | |
| Object.keys(given.dom).map(quoteRe).join('|') + ')\\s*(.*)'); | |
| var match = given._parse_dom_rule.exec(rule), type, func; | |
| <span class="missing-if-branch" title="else path not taken"" >E</span>if (match) { | |
| type = match[1]; | |
| rule = match[2]; | |
| func = test_dom[type]; | |
| } | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if (!func) <span class="cstat-no" title="statement not covered" >throw new Error('unknown dom match rule '+ type +': '+ rule);</span> | |
| return func.call(this, rule); | |
| } | |
| | |
| var results, result, i, property_name; | |
| <span class="missing-if-branch" title="else path not taken"" >E</span>if (context === undefined) { | |
| context = this === given || this === window ? document : this; | |
| } | |
| | |
| // validate context: | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if (context === null || context === FAIL) <span class="cstat-no" title="statement not covered" >return FAIL;</span> | |
| if (isArray(context)) { | |
| for (results = [], i = 0; i < context.length; i++) { | |
| result = test_dom.call(context[i], spec); | |
| <span class="missing-if-branch" title="else path not taken"" >E</span>if (result !== FAIL) | |
| results.push(result); | |
| } | |
| return results; | |
| } | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if (typeof context !== 'object' || !('nodeType' in context)) | |
| <span class="cstat-no" title="statement not covered" > throw new Error('illegal context: '+ context);</span> | |
| | |
| // handle input spec format: | |
| if (typeof spec === 'string') return lookup.call(context, spec); | |
| if (isArray(spec)) { | |
| context = lookup.call(context, spec[0]); | |
| if (context === null || context === FAIL) return context; | |
| return test_dom.call(context, spec[1]); | |
| } | |
| if (isObject(spec)) { | |
| results = {}; | |
| for (property_name in spec) { | |
| result = test_dom.call(context, spec[property_name]); | |
| if (result === FAIL) return FAIL; | |
| results[property_name] = result; | |
| } | |
| return results; | |
| } | |
| | |
| throw new Error("dom spec was neither a String, Object nor Array: "+ spec); | |
| } | |
| }; | |
| | |
| <span class="missing-if-branch" title="if path not taken"" >I</span>if ('module' in this) <span class="cstat-no" title="statement not covered" >module.exports = given;</span> | |
| </pre></td></tr> | |
| </table></pre> | |
| </div> | |
| <div class="footer"> | |
| <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Jul 06 2013 22:41:58 GMT-0700 (PDT)</div> | |
| </div> | |
| <script src="../prettify.js"></script> | |
| <script src="http://yui.yahooapis.com/3.6.0/build/yui/yui-min.js"></script> | |
| <script> | |
| YUI().use('datatable', function (Y) { | |
| var formatters = { | |
| pct: function (o) { | |
| o.className += o.record.get('classes')[o.column.key]; | |
| try { | |
| return o.value.toFixed(2) + '%'; | |
| } catch (ex) { return o.value + '%'; } | |
| }, | |
| html: function (o) { | |
| o.className += o.record.get('classes')[o.column.key]; | |
| return o.record.get(o.column.key + '_html'); | |
| } | |
| }, | |
| defaultFormatter = function (o) { | |
| o.className += o.record.get('classes')[o.column.key]; | |
| return o.value; | |
| }; | |
| function getColumns(theadNode) { | |
| var colNodes = theadNode.all('tr th'), | |
| cols = [], | |
| col; | |
| colNodes.each(function (colNode) { | |
| col = { | |
| key: colNode.getAttribute('data-col'), | |
| label: colNode.get('innerHTML') || ' ', | |
| sortable: !colNode.getAttribute('data-nosort'), | |
| className: colNode.getAttribute('class'), | |
| type: colNode.getAttribute('data-type'), | |
| allowHTML: colNode.getAttribute('data-html') === 'true' || colNode.getAttribute('data-fmt') === 'html' | |
| }; | |
| col.formatter = formatters[colNode.getAttribute('data-fmt')] || defaultFormatter; | |
| cols.push(col); | |
| }); | |
| return cols; | |
| } | |
| function getRowData(trNode, cols) { | |
| var tdNodes = trNode.all('td'), | |
| i, | |
| row = { classes: {} }, | |
| node, | |
| name; | |
| for (i = 0; i < cols.length; i += 1) { | |
| name = cols[i].key; | |
| node = tdNodes.item(i); | |
| row[name] = node.getAttribute('data-value') || node.get('innerHTML'); | |
| row[name + '_html'] = node.get('innerHTML'); | |
| row.classes[name] = node.getAttribute('class'); | |
| //Y.log('Name: ' + name + '; Value: ' + row[name]); | |
| if (cols[i].type === 'number') { row[name] = row[name] * 1; } | |
| } | |
| //Y.log(row); | |
| return row; | |
| } | |
| function getData(tbodyNode, cols) { | |
| var data = []; | |
| tbodyNode.all('tr').each(function (trNode) { | |
| data.push(getRowData(trNode, cols)); | |
| }); | |
| return data; | |
| } | |
| function replaceTable(node) { | |
| if (!node) { return; } | |
| var cols = getColumns(node.one('thead')), | |
| data = getData(node.one('tbody'), cols), | |
| table, | |
| parent = node.get('parentNode'); | |
| table = new Y.DataTable({ | |
| columns: cols, | |
| data: data, | |
| sortBy: 'file' | |
| }); | |
| parent.set('innerHTML', ''); | |
| table.render(parent); | |
| } | |
| Y.on('domready', function () { | |
| replaceTable(Y.one('div.coverage-summary table')); | |
| if (typeof prettyPrint === 'function') { | |
| prettyPrint(); | |
| } | |
| }); | |
| }); | |
| </script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <title>Code coverage report for ./</title> | |
| <meta charset="utf-8"> | |
| <link rel="stylesheet" href="../prettify.css"> | |
| <style> | |
| body, html { | |
| margin:0; padding: 0; | |
| } | |
| body { | |
| font-family: Helvetica Neue, Helvetica,Arial; | |
| font-size: 10pt; | |
| } | |
| div.header, div.footer { | |
| background: #eee; | |
| padding: 1em; | |
| } | |
| div.header { | |
| z-index: 100; | |
| position: fixed; | |
| top: 0; | |
| border-bottom: 1px solid #666; | |
| width: 100%; | |
| } | |
| div.footer { | |
| border-top: 1px solid #666; | |
| } | |
| div.body { | |
| margin-top: 10em; | |
| } | |
| div.meta { | |
| font-size: 90%; | |
| text-align: center; | |
| } | |
| h1, h2, h3 { | |
| font-weight: normal; | |
| } | |
| h1 { | |
| font-size: 12pt; | |
| } | |
| h2 { | |
| font-size: 10pt; | |
| } | |
| pre { | |
| font-family: Consolas, Menlo, Monaco, monospace; | |
| margin: 0; | |
| padding: 0; | |
| line-height: 14px; | |
| font-size: 14px; | |
| -moz-tab-size: 2; | |
| -o-tab-size: 2; | |
| tab-size: 2; | |
| } | |
| div.path { font-size: 110%; } | |
| div.path a:link, div.path a:visited { color: #000; } | |
| table.coverage { border-collapse: collapse; margin:0; padding: 0 } | |
| table.coverage td { | |
| margin: 0; | |
| padding: 0; | |
| color: #111; | |
| vertical-align: top; | |
| } | |
| table.coverage td.line-count { | |
| width: 50px; | |
| text-align: right; | |
| padding-right: 5px; | |
| } | |
| table.coverage td.line-coverage { | |
| color: #777 !important; | |
| text-align: right; | |
| border-left: 1px solid #666; | |
| border-right: 1px solid #666; | |
| } | |
| table.coverage td.text { | |
| } | |
| table.coverage td span.cline-any { | |
| display: inline-block; | |
| padding: 0 5px; | |
| width: 40px; | |
| } | |
| table.coverage td span.cline-neutral { | |
| background: #eee; | |
| } | |
| table.coverage td span.cline-yes { | |
| background: #b5d592; | |
| color: #999; | |
| } | |
| table.coverage td span.cline-no { | |
| background: #fc8c84; | |
| } | |
| .cstat-yes { color: #111; } | |
| .cstat-no { background: #fc8c84; color: #111; } | |
| .fstat-no { background: #ffc520; color: #111 !important; } | |
| .cbranch-no { background: yellow !important; color: #111; } | |
| .missing-if-branch { | |
| display: inline-block; | |
| margin-right: 10px; | |
| position: relative; | |
| padding: 0 4px; | |
| background: black; | |
| color: yellow; | |
| xtext-decoration: line-through; | |
| } | |
| .missing-if-branch .typ { | |
| color: inherit !important; | |
| } | |
| .entity, .metric { font-weight: bold; } | |
| .metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; } | |
| .metric small { font-size: 80%; font-weight: normal; color: #666; } | |
| div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; } | |
| div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; } | |
| div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; } | |
| div.coverage-summary th.file { border-right: none !important; } | |
| div.coverage-summary th.pic { border-left: none !important; text-align: right; } | |
| div.coverage-summary th.pct { border-right: none !important; } | |
| div.coverage-summary th.abs { border-left: none !important; text-align: right; } | |
| div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; } | |
| div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; } | |
| div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap; } | |
| div.coverage-summary td.pic { min-width: 120px !important; } | |
| div.coverage-summary a:link { text-decoration: none; color: #000; } | |
| div.coverage-summary a:visited { text-decoration: none; color: #333; } | |
| div.coverage-summary a:hover { text-decoration: underline; } | |
| div.coverage-summary tfoot td { border-top: 1px solid #666; } | |
| div.coverage-summary .yui3-datatable-sort-indicator, div.coverage-summary .dummy-sort-indicator { | |
| height: 10px; | |
| width: 7px; | |
| display: inline-block; | |
| margin-left: 0.5em; | |
| } | |
| div.coverage-summary .yui3-datatable-sort-indicator { | |
| background: url("http://yui.yahooapis.com/3.6.0/build/datatable-sort/assets/skins/sam/sort-arrow-sprite.png") no-repeat scroll 0 0 transparent; | |
| } | |
| div.coverage-summary .yui3-datatable-sorted .yui3-datatable-sort-indicator { | |
| background-position: 0 -20px; | |
| } | |
| div.coverage-summary .yui3-datatable-sorted-desc .yui3-datatable-sort-indicator { | |
| background-position: 0 -10px; | |
| } | |
| .high { background: #b5d592 !important; } | |
| .medium { background: #ffe87c !important; } | |
| .low { background: #fc8c84 !important; } | |
| span.cover-fill, span.cover-empty { | |
| display:inline-block; | |
| border:1px solid #444; | |
| background: white; | |
| height: 12px; | |
| } | |
| span.cover-fill { | |
| background: #ccc; | |
| border-right: 1px solid #444; | |
| } | |
| span.cover-empty { | |
| background: white; | |
| border-left: none; | |
| } | |
| span.cover-full { | |
| border-right: none !important; | |
| } | |
| pre.prettyprint { | |
| border: none !important; | |
| padding: 0 !important; | |
| margin: 0 !important; | |
| } | |
| .com { color: #999 !important; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="header medium"> | |
| <h1>Code coverage report for <span class="entity">./</span></h1> | |
| <h2> | |
| Statements: <span class="metric">73.76% <small>(149 / 202)</small></span> | |
| Branches: <span class="metric">66.67% <small>(92 / 138)</small></span> | |
| Functions: <span class="metric">75% <small>(24 / 32)</small></span> | |
| Lines: <span class="metric">75% <small>(120 / 160)</small></span> | |
| </h2> | |
| <div class="path"><a href="../index.html">All files</a> » ./</div> | |
| </div> | |
| <div class="body"> | |
| <div class="coverage-summary"> | |
| <table> | |
| <thead> | |
| <tr> | |
| <th data-col="file" data-fmt="html" data-html="true" class="file">File</th> | |
| <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th> | |
| <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th> | |
| <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th> | |
| <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th> | |
| <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th> | |
| <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th> | |
| <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th> | |
| <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th> | |
| <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th> | |
| </tr> | |
| </thead> | |
| <tbody><tr> | |
| <td class="file medium" data-value="given.js"><a href="given.js.html">given.js</a></td> | |
| <td data-value="73.76" class="pic medium"><span class="cover-fill" style="width: 73px;"></span><span class="cover-empty" style="width:27px;"></span></td> | |
| <td data-value="73.76" class="pct medium">73.76%</td> | |
| <td data-value="202" class="abs medium">(149 / 202)</td> | |
| <td data-value="66.67" class="pct medium">66.67%</td> | |
| <td data-value="138" class="abs medium">(92 / 138)</td> | |
| <td data-value="75" class="pct medium">75%</td> | |
| <td data-value="32" class="abs medium">(24 / 32)</td> | |
| <td data-value="75" class="pct medium">75%</td> | |
| <td data-value="160" class="abs medium">(120 / 160)</td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| <div class="footer"> | |
| <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat Jul 06 2013 22:41:58 GMT-0700 (PDT)</div> | |
| </div> | |
| <script src="../prettify.js"></script> | |
| <script src="http://yui.yahooapis.com/3.6.0/build/yui/yui-min.js"></script> | |
| <script> | |
| YUI().use('datatable', function (Y) { | |
| var formatters = { | |
| pct: function (o) { | |
| o.className += o.record.get('classes')[o.column.key]; | |
| try { | |
| return o.value.toFixed(2) + '%'; | |
| } catch (ex) { return o.value + '%'; } | |
| }, | |
| html: function (o) { | |
| o.className += o.record.get('classes')[o.column.key]; | |
| return o.record.get(o.column.key + '_html'); | |
| } | |
| }, | |
| defaultFormatter = function (o) { | |
| o.className += o.record.get('classes')[o.column.key]; | |
| return o.value; | |
| }; | |
| function getColumns(theadNode) { | |
| var colNodes = theadNode.all('tr th'), | |
| cols = [], | |
| col; | |
| colNodes.each(function (colNode) { | |
| col = { | |
| key: colNode.getAttribute('data-col'), | |
| label: colNode.get('innerHTML') || ' ', | |
| sortable: !colNode.getAttribute('data-nosort'), | |
| className: colNode.getAttribute('class'), | |
| type: colNode.getAttribute('data-type'), | |
| allowHTML: colNode.getAttribute('data-html') === 'true' || colNode.getAttribute('data-fmt') === 'html' | |
| }; | |
| col.formatter = formatters[colNode.getAttribute('data-fmt')] || defaultFormatter; | |
| cols.push(col); | |
| }); | |
| return cols; | |
| } | |
| function getRowData(trNode, cols) { | |
| var tdNodes = trNode.all('td'), | |
| i, | |
| row = { classes: {} }, | |
| node, | |
| name; | |
| for (i = 0; i < cols.length; i += 1) { | |
| name = cols[i].key; | |
| node = tdNodes.item(i); | |
| row[name] = node.getAttribute('data-value') || node.get('innerHTML'); | |
| row[name + '_html'] = node.get('innerHTML'); | |
| row.classes[name] = node.getAttribute('class'); | |
| //Y.log('Name: ' + name + '; Value: ' + row[name]); | |
| if (cols[i].type === 'number') { row[name] = row[name] * 1; } | |
| } | |
| //Y.log(row); | |
| return row; | |
| } | |
| function getData(tbodyNode, cols) { | |
| var data = []; | |
| tbodyNode.all('tr').each(function (trNode) { | |
| data.push(getRowData(trNode, cols)); | |
| }); | |
| return data; | |
| } | |
| function replaceTable(node) { | |
| if (!node) { return; } | |
| var cols = getColumns(node.one('thead')), | |
| data = getData(node.one('tbody'), cols), | |
| table, | |
| parent = node.get('parentNode'); | |
| table = new Y.DataTable({ | |
| columns: cols, | |
| data: data, | |
| sortBy: 'file' | |
| }); | |
| parent.set('innerHTML', ''); | |
| table.render(parent); | |
| } | |
| Y.on('domready', function () { | |
| replaceTable(Y.one('div.coverage-summary table')); | |
| if (typeof prettyPrint === 'function') { | |
| prettyPrint(); | |
| } | |
| }); | |
| }); | |
| </script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V<U;++V){var ae=Z[V];if(ae.ignoreCase){ac=true}else{if(/[a-z]/i.test(ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){S=true;ac=false;break}}}var Y={b:8,t:9,n:10,v:11,f:12,r:13};function ab(ah){var ag=ah.charCodeAt(0);if(ag!==92){return ag}var af=ah.charAt(1);ag=Y[af];if(ag){return ag}else{if("0"<=af&&af<="7"){return parseInt(ah.substring(1),8)}else{if(af==="u"||af==="x"){return parseInt(ah.substring(2),16)}else{return ah.charCodeAt(1)}}}}function T(af){if(af<32){return(af<16?"\\x0":"\\x")+af.toString(16)}var ag=String.fromCharCode(af);if(ag==="\\"||ag==="-"||ag==="["||ag==="]"){ag="\\"+ag}return ag}function X(am){var aq=am.substring(1,am.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));var ak=[];var af=[];var ao=aq[0]==="^";for(var ar=ao?1:0,aj=aq.length;ar<aj;++ar){var ah=aq[ar];if(/\\[bdsw]/i.test(ah)){ak.push(ah)}else{var ag=ab(ah);var al;if(ar+2<aj&&"-"===aq[ar+1]){al=ab(aq[ar+2]);ar+=2}else{al=ag}af.push([ag,al]);if(!(al<65||ag>122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;ar<af.length;++ar){var at=af[ar];if(at[0]<=ap[1]+1){ap[1]=Math.max(ap[1],at[1])}else{ai.push(ap=at)}}var an=["["];if(ao){an.push("^")}an.push.apply(an,ak);for(var ar=0;ar<ai.length;++ar){var at=ai[ar];an.push(T(at[0]));if(at[1]>at[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak<ah;++ak){var ag=aj[ak];if(ag==="("){++am}else{if("\\"===ag.charAt(0)){var af=+ag.substring(1);if(af&&af<=am){an[af]=-1}}}}for(var ak=1;ak<an.length;++ak){if(-1===an[ak]){an[ak]=++ad}}for(var ak=0,am=0;ak<ah;++ak){var ag=aj[ak];if(ag==="("){++am;if(an[am]===undefined){aj[ak]="(?:"}}else{if("\\"===ag.charAt(0)){var af=+ag.substring(1);if(af&&af<=am){aj[ak]="\\"+an[am]}}}}for(var ak=0,am=0;ak<ah;++ak){if("^"===aj[ak]&&"^"!==aj[ak+1]){aj[ak]=""}}if(al.ignoreCase&&S){for(var ak=0;ak<ah;++ak){var ag=aj[ak];var ai=ag.charAt(0);if(ag.length>=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V<U;++V){var ae=Z[V];if(ae.global||ae.multiline){throw new Error(""+ae)}aa.push("(?:"+W(ae)+")")}return new RegExp(aa.join("|"),ac?"gi":"g")}function a(V){var U=/(?:^|\s)nocode(?:\s|$)/;var X=[];var T=0;var Z=[];var W=0;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=document.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Y=S&&"pre"===S.substring(0,3);function aa(ab){switch(ab.nodeType){case 1:if(U.test(ab.className)){return}for(var ae=ab.firstChild;ae;ae=ae.nextSibling){aa(ae)}var ad=ab.nodeName;if("BR"===ad||"LI"===ad){X[W]="\n";Z[W<<1]=T++;Z[(W++<<1)|1]=ab}break;case 3:case 4:var ac=ab.nodeValue;if(ac.length){if(!Y){ac=ac.replace(/[ \t\r\n]+/g," ")}else{ac=ac.replace(/\r\n?/g,"\n")}X[W]=ac;Z[W<<1]=T;T+=ac.length;Z[(W++<<1)|1]=ab}break}}aa(V);return{sourceCode:X.join("").replace(/\n$/,""),spans:Z}}function B(S,U,W,T){if(!U){return}var V={sourceCode:U,basePos:S};W(V);T.push.apply(T,V.decorations)}var v=/\S/;function o(S){var V=undefined;for(var U=S.firstChild;U;U=U.nextSibling){var T=U.nodeType;V=(T===1)?(V?S:U):(T===3)?(v.test(U.nodeValue)?S:V):V}return V===S?undefined:V}function g(U,T){var S={};var V;(function(){var ad=U.concat(T);var ah=[];var ag={};for(var ab=0,Z=ad.length;ab<Z;++ab){var Y=ad[ab];var ac=Y[3];if(ac){for(var ae=ac.length;--ae>=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae<aq;++ae){var ag=an[ae];var ap=aj[ag];var ai=void 0;var am;if(typeof ap==="string"){am=false}else{var aa=S[ag.charAt(0)];if(aa){ai=ag.match(aa[1]);ap=aa[0]}else{for(var ao=0;ao<X;++ao){aa=T[ao];ai=ag.match(aa[1]);if(ai){ap=aa[0];break}}if(!ai){ap=F}}am=ap.length>=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y<W.length;++Y){ae(W[Y])}if(ag===(ag|0)){W[0].setAttribute("value",ag)}var aa=ac.createElement("OL");aa.className="linenums";var X=Math.max(0,((ag-1))|0)||0;for(var Y=0,T=W.length;Y<T;++Y){af=W[Y];af.className="L"+((Y+X)%10);if(!af.firstChild){af.appendChild(ac.createTextNode("\xA0"))}aa.appendChild(af)}V.appendChild(aa)}function D(ac){var aj=/\bMSIE\b/.test(navigator.userAgent);var am=/\n/g;var al=ac.sourceCode;var an=al.length;var V=0;var aa=ac.spans;var T=aa.length;var ah=0;var X=ac.decorations;var Y=X.length;var Z=0;X[Y]=an;var ar,aq;for(aq=ar=0;aq<Y;){if(X[aq]!==X[aq+2]){X[ar++]=X[aq++];X[ar++]=X[aq++]}else{aq+=2}}Y=ar;for(aq=ar=0;aq<Y;){var at=X[aq];var ab=X[aq+1];var W=aq+2;while(W+2<=Y&&X[W+1]===ab){W+=2}X[ar++]=at;X[ar++]=ab;aq=W}Y=X.length=ar;var ae=null;while(ah<T){var af=aa[ah];var S=aa[ah+2]||an;var ag=X[Z];var ap=X[Z+2]||an;var W=Math.min(S,ap);var ak=aa[ah+1];var U;if(ak.nodeType!==1&&(U=al.substring(V,W))){if(aj){U=U.replace(am,"\r")}ak.nodeValue=U;var ai=ak.ownerDocument;var ao=ai.createElement("SPAN");ao.className=X[Z+1];var ad=ak.parentNode;ad.replaceChild(ao,ak);ao.appendChild(ak);if(V<S){aa[ah+1]=ak=ai.createTextNode(al.substring(W,S));ad.insertBefore(ak,ao.nextSibling)}}V=W;if(V>=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*</.test(S)?"default-markup":"default-code"}return t[T]}c(K,["default-code"]);c(g([],[[F,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa<ac.length;++aa){for(var Z=0,V=ac[aa].length;Z<V;++Z){T.push(ac[aa][Z])}}ac=null;var W=Date;if(!W.now){W={now:function(){return +(new Date)}}}var X=0;var S;var ab=/\blang(?:uage)?-([\w.]+)(?!\S)/;var ae=/\bprettyprint\b/;function U(){var ag=(window.PR_SHOULD_USE_CONTINUATION?W.now()+250:Infinity);for(;X<T.length&&W.now()<ag;X++){var aj=T[X];var ai=aj.className;if(ai.indexOf("prettyprint")>=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X<T.length){setTimeout(U,250)}else{if(ad){ad()}}}U()}window.prettyPrintOne=y;window.prettyPrint=b;window.PR={createSimpleLexer:g,registerLangHandler:c,sourceDecorator:i,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:n,PR_COMMENT:j,PR_DECLARATION:E,PR_KEYWORD:z,PR_LITERAL:G,PR_NOCODE:N,PR_PLAIN:F,PR_PUNCTUATION:L,PR_SOURCE:J,PR_STRING:C,PR_TAG:m,PR_TYPE:O}})();PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_DECLARATION,/^<!\w[^>]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^<script\b[^>]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:<!--|-->)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment