diff --git a/minifyfromhtml.js b/minifyfromhtml.js index e69de29..b7e5a7d 100644 --- a/minifyfromhtml.js +++ b/minifyfromhtml.js @@ -0,0 +1,40 @@ +var argv = require('minimist')(process.argv.slice(2)); +var jsdom = require("jsdom"); +var {JSDOM} = jsdom; + +var usage = `usage: + minifyfromhtml < +`; + +var inputFile = argv.i; + +if (argv.h) { + console.log(usage); +} + +//read stdin +var html = ''; +process.stdin.resume(); +process.stdin.setEncoding('utf-8'); +process.stdin.on('data', function(buf) { + html += buf; +}); +process.stdin.on('end', function() { + var dom = new JSDOM(html); + var getScripts = function(dom) { + var scripts = []; + + var document = dom.window.document; + var scriptTags = document.getElementsByTagName('script'); + var i = scriptTags.length; + while (i--) { + var src = scriptTags[i].getAttribute('src'); + if (src) { + scripts.push(src); + } + } + return scripts; + } + + console.log(getScripts(dom)); +}); diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 120000 index 0000000..cf76760 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/escodegen b/node_modules/.bin/escodegen new file mode 120000 index 0000000..01a7c32 --- /dev/null +++ b/node_modules/.bin/escodegen @@ -0,0 +1 @@ +../escodegen/bin/escodegen.js \ No newline at end of file diff --git a/node_modules/.bin/esgenerate b/node_modules/.bin/esgenerate new file mode 120000 index 0000000..7d0293e --- /dev/null +++ b/node_modules/.bin/esgenerate @@ -0,0 +1 @@ +../escodegen/bin/esgenerate.js \ No newline at end of file diff --git a/node_modules/.bin/esparse b/node_modules/.bin/esparse new file mode 120000 index 0000000..7423b18 --- /dev/null +++ b/node_modules/.bin/esparse @@ -0,0 +1 @@ +../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/.bin/esvalidate b/node_modules/.bin/esvalidate new file mode 120000 index 0000000..16069ef --- /dev/null +++ b/node_modules/.bin/esvalidate @@ -0,0 +1 @@ +../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/.bin/sshpk-conv b/node_modules/.bin/sshpk-conv new file mode 120000 index 0000000..a2a295c --- /dev/null +++ b/node_modules/.bin/sshpk-conv @@ -0,0 +1 @@ +../sshpk/bin/sshpk-conv \ No newline at end of file diff --git a/node_modules/.bin/sshpk-sign b/node_modules/.bin/sshpk-sign new file mode 120000 index 0000000..766b9b3 --- /dev/null +++ b/node_modules/.bin/sshpk-sign @@ -0,0 +1 @@ +../sshpk/bin/sshpk-sign \ No newline at end of file diff --git a/node_modules/.bin/sshpk-verify b/node_modules/.bin/sshpk-verify new file mode 120000 index 0000000..bfd7e3a --- /dev/null +++ b/node_modules/.bin/sshpk-verify @@ -0,0 +1 @@ +../sshpk/bin/sshpk-verify \ No newline at end of file diff --git a/node_modules/.bin/uuid b/node_modules/.bin/uuid new file mode 120000 index 0000000..b3e45bc --- /dev/null +++ b/node_modules/.bin/uuid @@ -0,0 +1 @@ +../uuid/bin/uuid \ No newline at end of file diff --git a/node_modules/abab/CHANGELOG.md b/node_modules/abab/CHANGELOG.md new file mode 100644 index 0000000..cc62a65 --- /dev/null +++ b/node_modules/abab/CHANGELOG.md @@ -0,0 +1,15 @@ +## 1.0.4 + +- Added license file + +## 1.0.3 + +- Replaced `let` with `var` in `lib/btoa.js` + - Follow up from `1.0.2` + - Resolves https://github.com/jsdom/abab/issues/18 + +## 1.0.2 + +- Replaced `const` with `var` in `index.js` + - Allows use of `abab` in the browser without a transpilation step + - Resolves https://github.com/jsdom/abab/issues/15 diff --git a/node_modules/abab/LICENSE.md b/node_modules/abab/LICENSE.md new file mode 100644 index 0000000..5b59a83 --- /dev/null +++ b/node_modules/abab/LICENSE.md @@ -0,0 +1,11 @@ +Both the original source code and new contributions in this repository are released under the [W3C 3-clause BSD license](https://github.com/w3c/web-platform-tests/blob/master/LICENSE.md#w3c-3-clause-bsd-license). + +# W3C 3-clause BSD License + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of works must retain the original copyright notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the original copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +* Neither the name of the W3C nor the names of its contributors may be used to endorse or promote products derived from this work without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/abab/README.md b/node_modules/abab/README.md new file mode 100644 index 0000000..2d9c1b5 --- /dev/null +++ b/node_modules/abab/README.md @@ -0,0 +1,52 @@ +# abab + +[![npm version](https://badge.fury.io/js/abab.svg)](https://www.npmjs.com/package/abab) [![Build Status](https://travis-ci.org/jsdom/abab.svg?branch=master)](https://travis-ci.org/jsdom/abab) + +A module that implements `window.atob` and `window.btoa` according to the [WHATWG spec](https://html.spec.whatwg.org/multipage/webappapis.html#atob). The code is originally from [w3c/web-platform-tests](https://github.com/w3c/web-platform-tests/blob/master/html/webappapis/atob/base64.html). + +Compatibility: Node.js version 3+ and all major browsers (using browserify or webpack) + +Install with `npm`: + +```sh +npm install abab +``` + +## API + +### `btoa` (base64 encode) + +```js +const btoa = require('abab').btoa; +btoa('Hello, world!'); // 'SGVsbG8sIHdvcmxkIQ==' +``` + +### `atob` (base64 decode) + +```js +const atob = require('abab').atob; +atob('SGVsbG8sIHdvcmxkIQ=='); // 'Hello, world!' +``` + +#### Valid characters + +[Per the spec](https://html.spec.whatwg.org/multipage/webappapis.html#atob:dom-windowbase64-btoa-3), `btoa` will accept strings "containing only characters in the range `U+0000` to `U+00FF`." If passed a string with characters above `U+00FF`, `btoa` will return `null`. If `atob` is passed a string that is not base64-valid, it will also return `null`. In both cases when `null` is returned, the spec calls for throwing a `DOMException` of type `InvalidCharacterError`. + +## Browsers + +If you want to include just one of the methods to save bytes in your client-side code, you can `require` the desired module directly. + +```js +var atob = require('abab/lib/atob'); +var btoa = require('abab/lib/btoa'); +``` + +----- + +### Checklists + +If you're **submitting a PR** or **deploying to npm**, please use the [checklists in CONTRIBUTING.md](https://github.com/jsdom/abab/blob/master/CONTRIBUTING.md#checklists) + +### Remembering `atob` vs. `btoa` + +Here's a mnemonic that might be useful: if you have a plain string and want to base64 encode it, then decode it, `btoa` is what you run before (**b**efore - **b**toa), and `atob` is what you run after (**a**fter - **a**tob). diff --git a/node_modules/abab/index.js b/node_modules/abab/index.js new file mode 100644 index 0000000..16342c4 --- /dev/null +++ b/node_modules/abab/index.js @@ -0,0 +1,9 @@ +'use strict'; + +var atob = require('./lib/atob'); +var btoa = require('./lib/btoa'); + +module.exports = { + atob: atob, + btoa: btoa +}; diff --git a/node_modules/abab/lib/atob.js b/node_modules/abab/lib/atob.js new file mode 100644 index 0000000..ba2528f --- /dev/null +++ b/node_modules/abab/lib/atob.js @@ -0,0 +1,109 @@ +'use strict'; + +/** + * Implementation of atob() according to the HTML spec, except that instead of + * throwing INVALID_CHARACTER_ERR we return null. + */ +function atob(input) { + // WebIDL requires DOMStrings to just be converted using ECMAScript + // ToString, which in our case amounts to calling String(). + input = String(input); + // "Remove all space characters from input." + input = input.replace(/[ \t\n\f\r]/g, ''); + // "If the length of input divides by 4 leaving no remainder, then: if + // input ends with one or two U+003D EQUALS SIGN (=) characters, remove + // them from input." + if (input.length % 4 == 0 && /==?$/.test(input)) { + input = input.replace(/==?$/, ''); + } + // "If the length of input divides by 4 leaving a remainder of 1, throw an + // INVALID_CHARACTER_ERR exception and abort these steps." + // + // "If input contains a character that is not in the following list of + // characters and character ranges, throw an INVALID_CHARACTER_ERR + // exception and abort these steps: + // + // U+002B PLUS SIGN (+) + // U+002F SOLIDUS (/) + // U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9) + // U+0041 LATIN CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER Z + // U+0061 LATIN SMALL LETTER A to U+007A LATIN SMALL LETTER Z" + if (input.length % 4 == 1 || !/^[+/0-9A-Za-z]*$/.test(input)) { + return null; + } + // "Let output be a string, initially empty." + var output = ''; + // "Let buffer be a buffer that can have bits appended to it, initially + // empty." + // + // We append bits via left-shift and or. accumulatedBits is used to track + // when we've gotten to 24 bits. + var buffer = 0; + var accumulatedBits = 0; + // "While position does not point past the end of input, run these + // substeps:" + for (var i = 0; i < input.length; i++) { + // "Find the character pointed to by position in the first column of + // the following table. Let n be the number given in the second cell of + // the same row." + // + // "Append to buffer the six bits corresponding to number, most + // significant bit first." + // + // atobLookup() implements the table from the spec. + buffer <<= 6; + buffer |= atobLookup(input[i]); + // "If buffer has accumulated 24 bits, interpret them as three 8-bit + // big-endian numbers. Append the three characters with code points + // equal to those numbers to output, in the same order, and then empty + // buffer." + accumulatedBits += 6; + if (accumulatedBits == 24) { + output += String.fromCharCode((buffer & 0xff0000) >> 16); + output += String.fromCharCode((buffer & 0xff00) >> 8); + output += String.fromCharCode(buffer & 0xff); + buffer = accumulatedBits = 0; + } + // "Advance position by one character." + } + // "If buffer is not empty, it contains either 12 or 18 bits. If it + // contains 12 bits, discard the last four and interpret the remaining + // eight as an 8-bit big-endian number. If it contains 18 bits, discard the + // last two and interpret the remaining 16 as two 8-bit big-endian numbers. + // Append the one or two characters with code points equal to those one or + // two numbers to output, in the same order." + if (accumulatedBits == 12) { + buffer >>= 4; + output += String.fromCharCode(buffer); + } else if (accumulatedBits == 18) { + buffer >>= 2; + output += String.fromCharCode((buffer & 0xff00) >> 8); + output += String.fromCharCode(buffer & 0xff); + } + // "Return output." + return output; +} +/** + * A lookup table for atob(), which converts an ASCII character to the + * corresponding six-bit number. + */ +function atobLookup(chr) { + if (/[A-Z]/.test(chr)) { + return chr.charCodeAt(0) - 'A'.charCodeAt(0); + } + if (/[a-z]/.test(chr)) { + return chr.charCodeAt(0) - 'a'.charCodeAt(0) + 26; + } + if (/[0-9]/.test(chr)) { + return chr.charCodeAt(0) - '0'.charCodeAt(0) + 52; + } + if (chr == '+') { + return 62; + } + if (chr == '/') { + return 63; + } + // Throw exception; should not be hit in tests +} + +module.exports = atob; diff --git a/node_modules/abab/lib/btoa.js b/node_modules/abab/lib/btoa.js new file mode 100644 index 0000000..bc5b665 --- /dev/null +++ b/node_modules/abab/lib/btoa.js @@ -0,0 +1,65 @@ +'use strict'; + +/** + * btoa() as defined by the HTML5 spec, which mostly just references RFC4648. + */ +function btoa(s) { + var i; + // String conversion as required by WebIDL. + s = String(s); + // "The btoa() method must throw an INVALID_CHARACTER_ERR exception if the + // method's first argument contains any character whose code point is + // greater than U+00FF." + for (i = 0; i < s.length; i++) { + if (s.charCodeAt(i) > 255) { + return null; + } + } + var out = ''; + for (i = 0; i < s.length; i += 3) { + var groupsOfSix = [undefined, undefined, undefined, undefined]; + groupsOfSix[0] = s.charCodeAt(i) >> 2; + groupsOfSix[1] = (s.charCodeAt(i) & 0x03) << 4; + if (s.length > i + 1) { + groupsOfSix[1] |= s.charCodeAt(i + 1) >> 4; + groupsOfSix[2] = (s.charCodeAt(i + 1) & 0x0f) << 2; + } + if (s.length > i + 2) { + groupsOfSix[2] |= s.charCodeAt(i + 2) >> 6; + groupsOfSix[3] = s.charCodeAt(i + 2) & 0x3f; + } + for (var j = 0; j < groupsOfSix.length; j++) { + if (typeof groupsOfSix[j] == 'undefined') { + out += '='; + } else { + out += btoaLookup(groupsOfSix[j]); + } + } + } + return out; +} + +/** + * Lookup table for btoa(), which converts a six-bit number into the + * corresponding ASCII character. + */ +function btoaLookup(idx) { + if (idx < 26) { + return String.fromCharCode(idx + 'A'.charCodeAt(0)); + } + if (idx < 52) { + return String.fromCharCode(idx - 26 + 'a'.charCodeAt(0)); + } + if (idx < 62) { + return String.fromCharCode(idx - 52 + '0'.charCodeAt(0)); + } + if (idx == 62) { + return '+'; + } + if (idx == 63) { + return '/'; + } + // Throw INVALID_CHARACTER_ERR exception here -- won't be hit in the tests. +} + +module.exports = btoa; diff --git a/node_modules/abab/package.json b/node_modules/abab/package.json new file mode 100644 index 0000000..fa2efde --- /dev/null +++ b/node_modules/abab/package.json @@ -0,0 +1,75 @@ +{ + "_from": "abab@^1.0.4", + "_id": "abab@1.0.4", + "_inBundle": false, + "_integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", + "_location": "/abab", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "abab@^1.0.4", + "name": "abab", + "escapedName": "abab", + "rawSpec": "^1.0.4", + "saveSpec": null, + "fetchSpec": "^1.0.4" + }, + "_requiredBy": [ + "/data-urls", + "/jsdom" + ], + "_resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", + "_shasum": "5faad9c2c07f60dd76770f71cf025b62a63cfd4e", + "_spec": "abab@^1.0.4", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/jsdom", + "author": { + "name": "Jeff Carpenter", + "email": "gcarpenterv@gmail.com" + }, + "bugs": { + "url": "https://github.com/jsdom/abab/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "WHATWG spec-compliant implementations of window.atob and window.btoa.", + "devDependencies": { + "babel-core": "^6.1.4", + "babel-loader": "^6.1.0", + "babel-preset-es2015": "^6.1.4", + "eslint": "^1.3.1", + "jscs": "^2.1.1", + "karma": "^0.13.10", + "karma-cli": "^0.1.1", + "karma-firefox-launcher": "^0.1.6", + "karma-mocha": "^0.2.0", + "karma-sauce-launcher": "^0.2.14", + "karma-webpack": "^1.7.0", + "mocha": "^2.2.5", + "webpack": "^1.12.2" + }, + "files": [ + "index.js", + "lib/" + ], + "homepage": "https://github.com/jsdom/abab#readme", + "keywords": [ + "atob", + "btoa", + "browser" + ], + "license": "ISC", + "main": "index.js", + "name": "abab", + "repository": { + "type": "git", + "url": "git+https://github.com/jsdom/abab.git" + }, + "scripts": { + "karma": "karma start", + "lint": "jscs . && eslint .", + "mocha": "mocha test/node", + "test": "npm run lint && npm run mocha && npm run karma" + }, + "version": "1.0.4" +} diff --git a/node_modules/acorn-globals/LICENSE b/node_modules/acorn-globals/LICENSE new file mode 100644 index 0000000..27cc9f3 --- /dev/null +++ b/node_modules/acorn-globals/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Forbes Lindesay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/acorn-globals/README.md b/node_modules/acorn-globals/README.md new file mode 100644 index 0000000..d8cd372 --- /dev/null +++ b/node_modules/acorn-globals/README.md @@ -0,0 +1,76 @@ +# acorn-globals + +Detect global variables in JavaScript using acorn + +[![Build Status](https://img.shields.io/travis/ForbesLindesay/acorn-globals/master.svg)](https://travis-ci.org/ForbesLindesay/acorn-globals) +[![Dependency Status](https://img.shields.io/david/ForbesLindesay/acorn-globals.svg)](https://david-dm.org/ForbesLindesay/acorn-globals) +[![NPM version](https://img.shields.io/npm/v/acorn-globals.svg)](https://www.npmjs.org/package/acorn-globals) + +## Installation + + npm install acorn-globals + +## Usage + +detect.js + +```js +var fs = require('fs'); +var detect = require('acorn-globals'); + +var src = fs.readFileSync(__dirname + '/input.js', 'utf8'); + +var scope = detect(src); +console.dir(scope); +``` + +input.js + +```js +var x = 5; +var y = 3, z = 2; + +w.foo(); +w = 2; + +RAWR=444; +RAWR.foo(); + +BLARG=3; + +foo(function () { + var BAR = 3; + process.nextTick(function (ZZZZZZZZZZZZ) { + console.log('beep boop'); + var xyz = 4; + x += 10; + x.zzzzzz; + ZZZ=6; + }); + function doom () { + } + ZZZ.foo(); + +}); + +console.log(xyz); +``` + +output: + +``` +$ node example/detect.js +[ { name: 'BLARG', nodes: [ [Object] ] }, + { name: 'RAWR', nodes: [ [Object], [Object] ] }, + { name: 'ZZZ', nodes: [ [Object], [Object] ] }, + { name: 'console', nodes: [ [Object], [Object] ] }, + { name: 'foo', nodes: [ [Object] ] }, + { name: 'process', nodes: [ [Object] ] }, + { name: 'w', nodes: [ [Object], [Object] ] }, + { name: 'xyz', nodes: [ [Object] ] } ] +``` + + +## License + + MIT diff --git a/node_modules/acorn-globals/index.js b/node_modules/acorn-globals/index.js new file mode 100644 index 0000000..658ff68 --- /dev/null +++ b/node_modules/acorn-globals/index.js @@ -0,0 +1,167 @@ +'use strict'; + +var acorn = require('acorn'); +var walk = require('acorn/dist/walk'); + +function isScope(node) { + return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration' || node.type === 'ArrowFunctionExpression' || node.type === 'Program'; +} +function isBlockScope(node) { + return node.type === 'BlockStatement' || isScope(node); +} + +function declaresArguments(node) { + return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration'; +} + +function declaresThis(node) { + return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration'; +} + +function reallyParse(source, options) { + var parseOptions = Object.assign({}, options, + { + allowReturnOutsideFunction: true, + allowImportExportEverywhere: true, + allowHashBang: true + } + ); + return acorn.parse(source, parseOptions); +} +module.exports = findGlobals; +module.exports.parse = reallyParse; +function findGlobals(source, options) { + options = options || {}; + var globals = []; + var ast; + // istanbul ignore else + if (typeof source === 'string') { + ast = reallyParse(source, options); + } else { + ast = source; + } + // istanbul ignore if + if (!(ast && typeof ast === 'object' && ast.type === 'Program')) { + throw new TypeError('Source must be either a string of JavaScript or an acorn AST'); + } + var declareFunction = function (node) { + var fn = node; + fn.locals = fn.locals || {}; + node.params.forEach(function (node) { + declarePattern(node, fn); + }); + if (node.id) { + fn.locals[node.id.name] = true; + } + } + var declarePattern = function (node, parent) { + switch (node.type) { + case 'Identifier': + parent.locals[node.name] = true; + break; + case 'ObjectPattern': + node.properties.forEach(function (node) { + declarePattern(node.value, parent); + }); + break; + case 'ArrayPattern': + node.elements.forEach(function (node) { + if (node) declarePattern(node, parent); + }); + break; + case 'RestElement': + declarePattern(node.argument, parent); + break; + case 'AssignmentPattern': + declarePattern(node.left, parent); + break; + // istanbul ignore next + default: + throw new Error('Unrecognized pattern type: ' + node.type); + } + } + var declareModuleSpecifier = function (node, parents) { + ast.locals = ast.locals || {}; + ast.locals[node.local.name] = true; + } + walk.ancestor(ast, { + 'VariableDeclaration': function (node, parents) { + var parent = null; + for (var i = parents.length - 1; i >= 0 && parent === null; i--) { + if (node.kind === 'var' ? isScope(parents[i]) : isBlockScope(parents[i])) { + parent = parents[i]; + } + } + parent.locals = parent.locals || {}; + node.declarations.forEach(function (declaration) { + declarePattern(declaration.id, parent); + }); + }, + 'FunctionDeclaration': function (node, parents) { + var parent = null; + for (var i = parents.length - 2; i >= 0 && parent === null; i--) { + if (isScope(parents[i])) { + parent = parents[i]; + } + } + parent.locals = parent.locals || {}; + parent.locals[node.id.name] = true; + declareFunction(node); + }, + 'Function': declareFunction, + 'ClassDeclaration': function (node, parents) { + var parent = null; + for (var i = parents.length - 2; i >= 0 && parent === null; i--) { + if (isScope(parents[i])) { + parent = parents[i]; + } + } + parent.locals = parent.locals || {}; + parent.locals[node.id.name] = true; + }, + 'TryStatement': function (node) { + if (node.handler === null) return; + node.handler.locals = node.handler.locals || {}; + node.handler.locals[node.handler.param.name] = true; + }, + 'ImportDefaultSpecifier': declareModuleSpecifier, + 'ImportSpecifier': declareModuleSpecifier, + 'ImportNamespaceSpecifier': declareModuleSpecifier + }); + function identifier(node, parents) { + var name = node.name; + if (name === 'undefined') return; + for (var i = 0; i < parents.length; i++) { + if (name === 'arguments' && declaresArguments(parents[i])) { + return; + } + if (parents[i].locals && name in parents[i].locals) { + return; + } + } + node.parents = parents; + globals.push(node); + } + walk.ancestor(ast, { + 'VariablePattern': identifier, + 'Identifier': identifier, + 'ThisExpression': function (node, parents) { + for (var i = 0; i < parents.length; i++) { + if (declaresThis(parents[i])) { + return; + } + } + node.parents = parents; + globals.push(node); + } + }); + var groupedGlobals = {}; + globals.forEach(function (node) { + var name = node.type === 'ThisExpression' ? 'this' : node.name; + groupedGlobals[name] = (groupedGlobals[name] || []); + groupedGlobals[name].push(node); + }); + return Object.keys(groupedGlobals).sort().map(function (name) { + return {name: name, nodes: groupedGlobals[name]}; + }); +} diff --git a/node_modules/acorn-globals/package.json b/node_modules/acorn-globals/package.json new file mode 100644 index 0000000..7c85761 --- /dev/null +++ b/node_modules/acorn-globals/package.json @@ -0,0 +1,65 @@ +{ + "_from": "acorn-globals@^4.1.0", + "_id": "acorn-globals@4.1.0", + "_inBundle": false, + "_integrity": "sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==", + "_location": "/acorn-globals", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "acorn-globals@^4.1.0", + "name": "acorn-globals", + "escapedName": "acorn-globals", + "rawSpec": "^4.1.0", + "saveSpec": null, + "fetchSpec": "^4.1.0" + }, + "_requiredBy": [ + "/jsdom" + ], + "_resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.1.0.tgz", + "_shasum": "ab716025dbe17c54d3ef81d32ece2b2d99fe2538", + "_spec": "acorn-globals@^4.1.0", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/jsdom", + "author": { + "name": "ForbesLindesay" + }, + "bugs": { + "url": "https://github.com/ForbesLindesay/acorn-globals/issues" + }, + "bundleDependencies": false, + "dependencies": { + "acorn": "^5.0.0" + }, + "deprecated": false, + "description": "Detect global variables in JavaScript using acorn", + "devDependencies": { + "testit": "^3.0.0" + }, + "files": [ + "index.js", + "LICENSE" + ], + "homepage": "https://github.com/ForbesLindesay/acorn-globals#readme", + "keywords": [ + "ast", + "variable", + "name", + "lexical", + "scope", + "local", + "global", + "implicit" + ], + "license": "MIT", + "name": "acorn-globals", + "repository": { + "type": "git", + "url": "git+https://github.com/ForbesLindesay/acorn-globals.git" + }, + "scripts": { + "test": "node test" + }, + "version": "4.1.0" +} diff --git a/node_modules/acorn/AUTHORS b/node_modules/acorn/AUTHORS new file mode 100644 index 0000000..86c8d9b --- /dev/null +++ b/node_modules/acorn/AUTHORS @@ -0,0 +1,75 @@ +List of Acorn contributors. Updated before every release. + +Adrian Heine +Adrian Rakovsky +Alistair Braidwood +Amila Welihinda +Andres Suarez +Angelo +Aparajita Fishman +Arian Stolwijk +Artem Govorov +Boopesh Mahendran +Bradley Heinz +Brandon Mills +Charles Hughes +Charmander +Conrad Irwin +Daniel Tschinder +David Bonnet +Domenico Matteo +ehmicky +Felix Maier +Forbes Lindesay +Gilad Peleg +impinball +Ingvar Stepanyan +Jackson Ray Hamilton +Jesse McCarthy +Jiaxing Wang +Joel Kemp +Johannes Herr +John-David Dalton +Jordan Klassen +Jürg Lehni +Kai Cataldo +keeyipchan +Keheliya Gallaba +Kevin Irish +Kevin Kwok +krator +laosb +Marek +Marijn Haverbeke +Martin Carlberg +Mat Garcia +Mathias Bynens +Mathieu 'p01' Henri +Matthew Bastien +Max Schaefer +Max Zerzouri +Mihai Bazon +Mike Rennie +naoh +Nicholas C. Zakas +Nick Fitzgerald +Olivier Thomann +Oskar Schöldström +Paul Harper +Peter Rust +PlNG +Prayag Verma +ReadmeCritic +r-e-d +Richard Gibson +Rich Harris +Sebastian McKenzie +Shahar Soel +Sheel Bedi +Simen Bekkhus +Teddy Katz +Timothy Gu +Toru Nagashima +Victor Homyakov +Wexpo Lyu +zsjforcn diff --git a/node_modules/acorn/CHANGELOG.md b/node_modules/acorn/CHANGELOG.md new file mode 100644 index 0000000..f9e5a4f --- /dev/null +++ b/node_modules/acorn/CHANGELOG.md @@ -0,0 +1,454 @@ +## 5.5.3 (2018-03-08) + +### Bug fixes + +A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps. + +## 5.5.2 (2018-03-08) + +### Bug fixes + +A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0. + +## 5.5.2 (2018-03-08) + +### Bug fixes + +A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0. + +## 5.5.1 (2018-03-06) + +### Bug fixes + +Fix regression in walker causing property values in object patterns to be walked as expressions. + +Fix misleading error message for octal escapes in template strings. + +## 5.5.0 (2018-02-27) + +### Bug fixes + +Support object spread in the AST walker. + +### New features + +The identifier character categorization is now based on Unicode version 10. + +Acorn will now validate the content of regular expressions, including new ES9 features. + +## 5.4.1 (2018-02-02) + +### Bug fixes + +5.4.0 somehow accidentally included an old version of walk.js. + +## 5.4.0 (2018-02-01) + +### Bug fixes + +Disallow duplicate or escaped flags on regular expressions. + +Disallow octal escapes in strings in strict mode. + +### New features + +Add support for async iteration. + +Add support for object spread and rest. + +## 5.3.0 (2017-12-28) + +### Bug fixes + +Fix parsing of floating point literals with leading zeroes in loose mode. + +Allow duplicate property names in object patterns. + +Don't allow static class methods named `prototype`. + +Disallow async functions directly under `if` or `else`. + +Parse right-hand-side of `for`/`of` as an assignment expression. + +Stricter parsing of `for`/`in`. + +Don't allow unicode escapes in contextual keywords. + +### New features + +Parsing class members was factored into smaller methods to allow plugins to hook into it. + +## 5.2.1 (2017-10-30) + +### Bug fixes + +Fix a token context corruption bug. + +## 5.2.0 (2017-10-30) + +### Bug fixes + +Fix token context tracking for `class` and `function` in property-name position. + +Make sure `%*` isn't parsed as a valid operator. + +The `full` and `fullAncestor` walkers no longer visit nodes multiple times. + +Allow shorthand properties `get` and `set` to be followed by default values. + +Disallow `super` when not in callee or object position. + +### New features + +Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements. + +## 5.1.2 (2017-09-04) + +### Bug fixes + +Disable parsing of legacy HTML-style comments in modules. + +Fix parsing of async methods whose names are keywords. + +## 5.1.1 (2017-07-06) + +### Bug fixes + +Fix problem with disambiguating regexp and division after a class. + +## 5.1.0 (2017-07-05) + +### Bug fixes + +Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`. + +Parse zero-prefixed numbers with non-octal digits as decimal. + +Allow object/array patterns in rest parameters. + +Don't error when `yield` is used as a property name. + +Allow `async` as a shorthand object property. + +Make the ES module version of the loose parser actually work. + +### New features + +Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9. + +New walker functions `full` and `fullAncestor`. + +## 5.0.3 (2017-04-01) + +### Bug fixes + +Fix spurious duplicate variable definition errors for named functions. + +## 5.0.2 (2017-03-30) + +### Bug fixes + +A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error. + +## 5.0.0 (2017-03-28) + +### Bug fixes + +Raise an error for duplicated lexical bindings. + +Fix spurious error when an assignement expression occurred after a spread expression. + +Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions. + +Allow labels in front or `var` declarations, even in strict mode. + +### Breaking changes + +Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`. + +## 4.0.11 (2017-02-07) + +### Bug fixes + +Allow all forms of member expressions to be parenthesized as lvalue. + +## 4.0.10 (2017-02-07) + +### Bug fixes + +Don't expect semicolons after default-exported functions or classes, +even when they are expressions. + +Check for use of `'use strict'` directives in non-simple parameter +functions, even when already in strict mode. + +## 4.0.9 (2017-02-06) + +### Bug fixes + +Fix incorrect error raised for parenthesized simple assignment +targets, so that `(x) = 1` parses again. + +## 4.0.8 (2017-02-03) + +### Bug fixes + +Solve spurious parenthesized pattern errors by temporarily erring on +the side of accepting programs that our delayed errors don't handle +correctly yet. + +## 4.0.7 (2017-02-02) + +### Bug fixes + +Accept invalidly rejected code like `(x).y = 2` again. + +Don't raise an error when a function _inside_ strict code has a +non-simple parameter list. + +## 4.0.6 (2017-02-02) + +### Bug fixes + +Fix exponential behavior (manifesting itself as a complete hang for +even relatively small source files) introduced by the new 'use strict' +check. + +## 4.0.5 (2017-02-02) + +### Bug fixes + +Disallow parenthesized pattern expressions. + +Allow keywords as export names. + +Don't allow the `async` keyword to be parenthesized. + +Properly raise an error when a keyword contains a character escape. + +Allow `"use strict"` to appear after other string literal expressions. + +Disallow labeled declarations. + +## 4.0.4 (2016-12-19) + +### Bug fixes + +Fix issue with loading acorn_loose.js with an AMD loader. + +Fix crash when `export` was followed by a keyword that can't be +exported. + +## 4.0.3 (2016-08-16) + +### Bug fixes + +Allow regular function declarations inside single-statement `if` +branches in loose mode. Forbid them entirely in strict mode. + +Properly parse properties named `async` in ES2017 mode. + +Fix bug where reserved words were broken in ES2017 mode. + +## 4.0.2 (2016-08-11) + +### Bug fixes + +Don't ignore period or 'e' characters after octal numbers. + +Fix broken parsing for call expressions in default parameter values +of arrow functions. + +## 4.0.1 (2016-08-08) + +### Bug fixes + +Fix false positives in duplicated export name errors. + +## 4.0.0 (2016-08-07) + +### Breaking changes + +The default `ecmaVersion` option value is now 7. + +A number of internal method signatures changed, so plugins might need +to be updated. + +### Bug fixes + +The parser now raises errors on duplicated export names. + +`arguments` and `eval` can now be used in shorthand properties. + +Duplicate parameter names in non-simple argument lists now always +produce an error. + +### New features + +The `ecmaVersion` option now also accepts year-style version numbers +(2015, etc). + +Support for `async`/`await` syntax when `ecmaVersion` is >= 8. + +Support for trailing commas in call expressions when `ecmaVersion` +is >= 8. + +## 3.3.0 (2016-07-25) + +### Bug fixes + +Fix bug in tokenizing of regexp operator after a function declaration. + +Fix parser crash when parsing an array pattern with a hole. + +### New features + +Implement check against complex argument lists in functions that +enable strict mode in ES7. + +## 3.2.0 (2016-06-07) + +### Bug fixes + +Improve handling of lack of unicode regexp support in host +environment. + +Properly reject shorthand properties whose name is a keyword. + +Don't crash when the loose parser is called without options object. + +### New features + +Visitors created with `visit.make` now have their base as _prototype_, +rather than copying properties into a fresh object. + +Make it possible to use `visit.ancestor` with a walk state. + +## 3.1.0 (2016-04-18) + +### Bug fixes + +Fix issue where the loose parser created invalid TemplateElement nodes +for unclosed template literals. + +Properly tokenize the division operator directly after a function +expression. + +Allow trailing comma in destructuring arrays. + +### New features + +The walker now allows defining handlers for `CatchClause` nodes. + +## 3.0.4 (2016-02-25) + +### Fixes + +Allow update expressions as left-hand-side of the ES7 exponential +operator. + +## 3.0.2 (2016-02-10) + +### Fixes + +Fix bug that accidentally made `undefined` a reserved word when +parsing ES7. + +## 3.0.0 (2016-02-10) + +### Breaking changes + +The default value of the `ecmaVersion` option is now 6 (used to be 5). + +Support for comprehension syntax (which was dropped from the draft +spec) has been removed. + +### Fixes + +`let` and `yield` are now “contextual keywords”, meaning you can +mostly use them as identifiers in ES5 non-strict code. + +A parenthesized class or function expression after `export default` is +now parsed correctly. + +### New features + +When `ecmaVersion` is set to 7, Acorn will parse the exponentiation +operator (`**`). + +The identifier character ranges are now based on Unicode 8.0.0. + +Plugins can now override the `raiseRecoverable` method to override the +way non-critical errors are handled. + +## 2.7.0 (2016-01-04) + +### Fixes + +Stop allowing rest parameters in setters. + +Make sure the loose parser always attaches a `local` property to +`ImportNamespaceSpecifier` nodes. + +Disallow `y` rexexp flag in ES5. + +Disallow `\00` and `\000` escapes in strict mode. + +Raise an error when an import name is a reserved word. + +## 2.6.4 (2015-11-12) + +### Fixes + +Fix crash in loose parser when parsing invalid object pattern. + +### New features + +Support plugins in the loose parser. + +## 2.6.2 (2015-11-10) + +### Fixes + +Don't crash when no options object is passed. + +## 2.6.0 (2015-11-09) + +### Fixes + +Add `await` as a reserved word in module sources. + +Disallow `yield` in a parameter default value for a generator. + +Forbid using a comma after a rest pattern in an array destructuring. + +### New features + +Support parsing stdin in command-line tool. + +## 2.5.2 (2015-10-27) + +### Fixes + +Fix bug where the walker walked an exported `let` statement as an +expression. + +## 2.5.0 (2015-10-27) + +### Fixes + +Fix tokenizer support in the command-line tool. + +In the loose parser, don't allow non-string-literals as import +sources. + +Stop allowing `new.target` outside of functions. + +Remove legacy `guard` and `guardedHandler` properties from try nodes. + +Stop allowing multiple `__proto__` properties on an object literal in +strict mode. + +Don't allow rest parameters to be non-identifier patterns. + +Check for duplicate paramter names in arrow functions. diff --git a/node_modules/acorn/LICENSE b/node_modules/acorn/LICENSE new file mode 100644 index 0000000..2c0632b --- /dev/null +++ b/node_modules/acorn/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2018 by various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/acorn/README.md b/node_modules/acorn/README.md new file mode 100644 index 0000000..276dab3 --- /dev/null +++ b/node_modules/acorn/README.md @@ -0,0 +1,465 @@ +# Acorn + +[![Build Status](https://travis-ci.org/acornjs/acorn.svg?branch=master)](https://travis-ci.org/acornjs/acorn) +[![NPM version](https://img.shields.io/npm/v/acorn.svg)](https://www.npmjs.com/package/acorn) +[![CDNJS](https://img.shields.io/cdnjs/v/acorn.svg)](https://cdnjs.com/libraries/acorn) +[Author funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?force)](https://marijnhaverbeke.nl/fund/) + +A tiny, fast JavaScript parser, written completely in JavaScript. + +## Community + +Acorn is open source software released under an +[MIT license](https://github.com/acornjs/acorn/blob/master/LICENSE). + +You are welcome to +[report bugs](https://github.com/acornjs/acorn/issues) or create pull +requests on [github](https://github.com/acornjs/acorn). For questions +and discussion, please use the +[Tern discussion forum](https://discuss.acornjs.net). + +## Installation + +The easiest way to install acorn is with [`npm`][npm]. + +[npm]: https://www.npmjs.com/ + +```sh +npm install acorn +``` + +Alternately, you can download the source and build acorn yourself: + +```sh +git clone https://github.com/acornjs/acorn.git +cd acorn +npm install +npm run build +``` + +## Components + +When run in a CommonJS (node.js) or AMD environment, exported values +appear in the interfaces exposed by the individual files, as usual. +When loaded in the browser (Acorn works in any JS-enabled browser more +recent than IE5) without any kind of module management, a single +global object `acorn` will be defined, and all the exported properties +will be added to that. + +### Main parser + +This is implemented in `dist/acorn.js`, and is what you get when you +`require("acorn")` in node.js. + +**parse**`(input, options)` is used to parse a JavaScript program. +The `input` parameter is a string, `options` can be undefined or an +object setting some of the options listed below. The return value will +be an abstract syntax tree object as specified by the +[ESTree spec][estree]. + +When encountering a syntax error, the parser will raise a +`SyntaxError` object with a meaningful message. The error object will +have a `pos` property that indicates the character offset at which the +error occurred, and a `loc` object that contains a `{line, column}` +object referring to that same position. + +[estree]: https://github.com/estree/estree + +- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be + either 3, 5, 6 (2015), 7 (2016), 8 (2017), or 9 (2018, partial + support). This influences support for strict mode, the set of + reserved words, and support for new syntax features. Default is 7. + + **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being + implemented by Acorn. + +- **sourceType**: Indicate the mode the code should be parsed in. Can be + either `"script"` or `"module"`. This influences global strict mode + and parsing of `import` and `export` declarations. + +- **onInsertedSemicolon**: If given a callback, that callback will be + called whenever a missing semicolon is inserted by the parser. The + callback will be given the character offset of the point where the + semicolon is inserted as argument, and if `locations` is on, also a + `{line, column}` object representing this position. + +- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing + commas. + +- **allowReserved**: If `false`, using a reserved word will generate + an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher + versions. When given the value `"never"`, reserved words and + keywords can also not be used as property names (as in Internet + Explorer's old parser). + +- **allowReturnOutsideFunction**: By default, a return statement at + the top level raises an error. Set this to `true` to accept such + code. + +- **allowImportExportEverywhere**: By default, `import` and `export` + declarations can only appear at a program's top level. Setting this + option to `true` allows them anywhere where a statement is allowed. + +- **allowHashBang**: When this is enabled (off by default), if the + code starts with the characters `#!` (as in a shellscript), the + first line will be treated as a comment. + +- **locations**: When `true`, each node has a `loc` object attached + with `start` and `end` subobjects, each of which contains the + one-based line and zero-based column numbers in `{line, column}` + form. Default is `false`. + +- **onToken**: If a function is passed for this option, each found + token will be passed in same format as tokens returned from + `tokenizer().getToken()`. + + If array is passed, each found token is pushed to it. + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **onComment**: If a function is passed for this option, whenever a + comment is encountered the function will be called with the + following parameters: + + - `block`: `true` if the comment is a block comment, false if it + is a line comment. + - `text`: The content of the comment. + - `start`: Character offset of the start of the comment. + - `end`: Character offset of the end of the comment. + + When the `locations` options is on, the `{line, column}` locations + of the comment’s start and end are passed as two additional + parameters. + + If array is passed for this option, each found comment is pushed + to it as object in Esprima format: + + ```javascript + { + "type": "Line" | "Block", + "value": "comment text", + "start": Number, + "end": Number, + // If `locations` option is on: + "loc": { + "start": {line: Number, column: Number} + "end": {line: Number, column: Number} + }, + // If `ranges` option is on: + "range": [Number, Number] + } + ``` + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **ranges**: Nodes have their start and end characters offsets + recorded in `start` and `end` properties (directly on the node, + rather than the `loc` object, which holds line/column data. To also + add a [semi-standardized][range] `range` property holding a + `[start, end]` array with the same numbers, set the `ranges` option + to `true`. + +- **program**: It is possible to parse multiple files into a single + AST by passing the tree produced by parsing the first file as the + `program` option in subsequent parses. This will add the toplevel + forms of the parsed file to the "Program" (top) node of an existing + parse tree. + +- **sourceFile**: When the `locations` option is `true`, you can pass + this option to add a `source` attribute in every node’s `loc` + object. Note that the contents of this option are not examined or + processed in any way; you are free to use whatever format you + choose. + +- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property + will be added (regardless of the `location` option) directly to the + nodes, rather than the `loc` object. + +- **preserveParens**: If this option is `true`, parenthesized expressions + are represented by (non-standard) `ParenthesizedExpression` nodes + that have a single `expression` property containing the expression + inside parentheses. + +[range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + +**parseExpressionAt**`(input, offset, options)` will parse a single +expression in a string, and return its AST. It will not complain if +there is more of the string left after the expression. + +**getLineInfo**`(input, offset)` can be used to get a `{line, +column}` object for a given program string and character offset. + +**tokenizer**`(input, options)` returns an object with a `getToken` +method that can be called repeatedly to get the next token, a `{start, +end, type, value}` object (with added `loc` property when the +`locations` option is enabled and `range` property when the `ranges` +option is enabled). When the token's type is `tokTypes.eof`, you +should stop calling the method, since it will keep returning that same +token forever. + +In ES6 environment, returned result can be used as any other +protocol-compliant iterable: + +```javascript +for (let token of acorn.tokenizer(str)) { + // iterate over the tokens +} + +// transform code to array of tokens: +var tokens = [...acorn.tokenizer(str)]; +``` + +**tokTypes** holds an object mapping names to the token type objects +that end up in the `type` properties of tokens. + +#### Note on using with [Escodegen][escodegen] + +Escodegen supports generating comments from AST, attached in +Esprima-specific format. In order to simulate same format in +Acorn, consider following example: + +```javascript +var comments = [], tokens = []; + +var ast = acorn.parse('var x = 42; // answer', { + // collect ranges for each node + ranges: true, + // collect comments in Esprima's format + onComment: comments, + // collect token ranges + onToken: tokens +}); + +// attach comments using collected information +escodegen.attachComments(ast, comments, tokens); + +// generate code +console.log(escodegen.generate(ast, {comment: true})); +// > 'var x = 42; // answer' +``` + +[escodegen]: https://github.com/estools/escodegen + +### dist/acorn_loose.js ### + +This file implements an error-tolerant parser. It exposes a single +function. The loose parser is accessible in node.js via `require("acorn/dist/acorn_loose")`. + +**parse_dammit**`(input, options)` takes the same arguments and +returns the same syntax tree as the `parse` function in `acorn.js`, +but never raises an error, and will do its best to parse syntactically +invalid code in as meaningful a way as it can. It'll insert identifier +nodes with name `"✖"` as placeholders in places where it can't make +sense of the input. Depends on `acorn.js`, because it uses the same +tokenizer. + +### dist/walk.js ### + +Implements an abstract syntax tree walker. Will store its interface in +`acorn.walk` when loaded without a module system. + +**simple**`(node, visitors, base, state)` does a 'simple' walk over +a tree. `node` should be the AST node to walk, and `visitors` an +object with properties whose names correspond to node types in the +[ESTree spec][estree]. The properties should contain functions +that will be called with the node object and, if applicable the state +at that point. The last two arguments are optional. `base` is a walker +algorithm, and `state` is a start state. The default walker will +simply visit all statements and expressions and not produce a +meaningful state. (An example of a use of state is to track scope at +each point in the tree.) + +```js +const acorn = require("acorn") +const walk = require("acorn/dist/walk") + +walk.simple(acorn.parse("let x = 10"), { + Literal(node) { + console.log(`Found a literal: ${node.value}`) + } +}) +``` + +**ancestor**`(node, visitors, base, state)` does a 'simple' walk over +a tree, building up an array of ancestor nodes (including the current node) +and passing the array to the callbacks as a third parameter. + +```js +const acorn = require("acorn") +const walk = require("acorn/dist/walk") + +walk.ancestor(acorn.parse("foo('hi')"), { + Literal(_, ancestors) { + console.log("This literal's ancestors are:", + ancestors.map(n => n.type)) + } +}) +``` + +**recursive**`(node, state, functions, base)` does a 'recursive' +walk, where the walker functions are responsible for continuing the +walk on the child nodes of their target node. `state` is the start +state, and `functions` should contain an object that maps node types +to walker functions. Such functions are called with `(node, state, c)` +arguments, and can cause the walk to continue on a sub-node by calling +the `c` argument on it with `(node, state)` arguments. The optional +`base` argument provides the fallback walker functions for node types +that aren't handled in the `functions` object. If not given, the +default walkers will be used. + +**make**`(functions, base)` builds a new walker object by using the +walker functions in `functions` and filling in the missing ones by +taking defaults from `base`. + +**full**`(node, callback, base, state)` does a 'full' +walk over a tree, calling the callback with the arguments (node, state, type) +for each node + +**fullAncestor**`(node, callback, base, state)` does a 'full' walk over +a tree, building up an array of ancestor nodes (including the current node) +and passing the array to the callbacks as a third parameter. + +```js +const acorn = require("acorn") +const walk = require("acorn/dist/walk") + +walk.full(acorn.parse("1 + 1"), node => { + console.log(`There's a ${node.type} node at ${node.ch}`) +}) +``` + +**findNodeAt**`(node, start, end, test, base, state)` tries to +locate a node in a tree at the given start and/or end offsets, which +satisfies the predicate `test`. `start` and `end` can be either `null` +(as wildcard) or a number. `test` may be a string (indicating a node +type) or a function that takes `(nodeType, node)` arguments and +returns a boolean indicating whether this node is interesting. `base` +and `state` are optional, and can be used to specify a custom walker. +Nodes are tested from inner to outer, so if two nodes match the +boundaries, the inner one will be preferred. + +**findNodeAround**`(node, pos, test, base, state)` is a lot like +`findNodeAt`, but will match any node that exists 'around' (spanning) +the given position. + +**findNodeAfter**`(node, pos, test, base, state)` is similar to +`findNodeAround`, but will match all nodes *after* the given position +(testing outer nodes before inner nodes). + +## Command line interface + +The `bin/acorn` utility can be used to parse a file from the command +line. It accepts as arguments its input file and the following +options: + +- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9`: Sets the ECMAScript version + to parse. Default is version 7. + +- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. + +- `--locations`: Attaches a "loc" object to each node with "start" and + "end" subobjects, each of which contains the one-based line and + zero-based column numbers in `{line, column}` form. + +- `--allow-hash-bang`: If the code starts with the characters #! (as in a shellscript), the first line will be treated as a comment. + +- `--compact`: No whitespace is used in the AST output. + +- `--silent`: Do not output the AST, just return the exit status. + +- `--help`: Print the usage information and quit. + +The utility spits out the syntax tree as JSON data. + +## Build system + +Acorn is written in ECMAScript 6, as a set of small modules, in the +project's `src` directory, and compiled down to bigger ECMAScript 3 +files in `dist` using [Browserify](http://browserify.org) and +[Babel](http://babeljs.io/). If you are already using Babel, you can +consider including the modules directly. + +The command-line test runner (`npm test`) uses the ES6 modules. The +browser-based test page (`test/index.html`) uses the compiled modules. +The `bin/build-acorn.js` script builds the latter from the former. + +If you are working on Acorn, you'll probably want to try the code out +directly, without an intermediate build step. In your scripts, you can +register the Babel require shim like this: + + require("babel-core/register") + +That will allow you to directly `require` the ES6 modules. + +## Plugins + +Acorn is designed support allow plugins which, within reasonable +bounds, redefine the way the parser works. Plugins can add new token +types and new tokenizer contexts (if necessary), and extend methods in +the parser object. This is not a clean, elegant API—using it requires +an understanding of Acorn's internals, and plugins are likely to break +whenever those internals are significantly changed. But still, it is +_possible_, in this way, to create parsers for JavaScript dialects +without forking all of Acorn. And in principle it is even possible to +combine such plugins, so that if you have, for example, a plugin for +parsing types and a plugin for parsing JSX-style XML literals, you +could load them both and parse code with both JSX tags and types. + +A plugin should register itself by adding a property to +`acorn.plugins`, which holds a function. Calling `acorn.parse`, a +`plugins` option can be passed, holding an object mapping plugin names +to configuration values (or just `true` for plugins that don't take +options). After the parser object has been created, the initialization +functions for the chosen plugins are called with `(parser, +configValue)` arguments. They are expected to use the `parser.extend` +method to extend parser methods. For example, the `readToken` method +could be extended like this: + +```javascript +parser.extend("readToken", function(nextMethod) { + return function(code) { + console.log("Reading a token!") + return nextMethod.call(this, code) + } +}) +``` + +The `nextMethod` argument passed to `extend`'s second argument is the +previous value of this method, and should usually be called through to +whenever the extended method does not handle the call itself. + +Similarly, the loose parser allows plugins to register themselves via +`acorn.pluginsLoose`. The extension mechanism is the same as for the +normal parser: + +```javascript +looseParser.extend("readToken", function(nextMethod) { + return function() { + console.log("Reading a token in the loose parser!") + return nextMethod.call(this) + } +}) +``` + +### Existing plugins + + - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx) + - [`acorn-objj`](https://github.com/cappuccino/acorn-objj): [Objective-J](http://www.cappuccino-project.org/learn/objective-j.html) language parser built as Acorn plugin + + Plugins for ECMAScript proposals: + + - [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling: + - [`acorn-async-iteration`](https://github.com/acornjs/acorn-async-iteration): Parse [async iteration proposal](https://github.com/tc39/proposal-async-iteration) + - [`acorn-bigint`](https://github.com/acornjs/acorn-bigint): Parse [BigInt proposal](https://github.com/tc39/proposal-bigint) + - [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields) + - [`acorn-dynamic-import`](https://github.com/kesne/acorn-dynamic-import): Parse [import() proposal](https://github.com/tc39/proposal-dynamic-import) + - [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta) + - [`acorn-numeric-separator`](https://github.com/acornjs/acorn-numeric-separator): Parse [numeric separator proposal](https://github.com/tc39/proposal-numeric-separator) + - [`acorn-optional-catch-binding`](https://github.com/acornjs/acorn-optional-catch-binding): Parse [optional catch binding proposal](https://github.com/tc39/proposal-optional-catch-binding) + - [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods) + - [`acorn5-object-spread`](https://github.com/adrianheine/acorn5-object-spread): Parse [Object Rest/Spread Properties proposal](https://github.com/tc39/proposal-object-rest-spread) + - [`acorn-object-rest-spread`](https://github.com/victor-homyakov/acorn-object-rest-spread): Parse [Object Rest/Spread Properties proposal](https://github.com/tc39/proposal-object-rest-spread) + - [`acorn-es7`](https://github.com/angelozerr/acorn-es7): Parse [decorator syntax proposal](https://github.com/wycats/javascript-decorators) + - [`acorn-static-class-property-initializer`](https://github.com/victor-homyakov/acorn-static-class-property-initializer): Partial support for static class properties from [ES Class Fields & Static Properties Proposal](https://github.com/tc39/proposal-class-public-fields) to support static property initializers in [React components written as ES6+ classes](https://babeljs.io/blog/2015/06/07/react-on-es6-plus) diff --git a/node_modules/acorn/bin/_acorn.js b/node_modules/acorn/bin/_acorn.js new file mode 100644 index 0000000..830c389 --- /dev/null +++ b/node_modules/acorn/bin/_acorn.js @@ -0,0 +1,69 @@ +#!/usr/bin/env node +'use strict'; + +var path = require('path'); +var fs = require('fs'); +var acorn = require('../dist/acorn.js'); + +var infile; +var forceFile; +var silent = false; +var compact = false; +var tokenize = false; +var options = {}; + +function help(status) { + var print = (status == 0) ? console.log : console.error; + print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|...|--ecma2015|--ecma2016|--ecma2017|--ecma2018|...]"); + print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]"); + process.exit(status); +} + +for (var i = 2; i < process.argv.length; ++i) { + var arg = process.argv[i]; + if ((arg == "-" || arg[0] != "-") && !infile) { infile = arg; } + else if (arg == "--" && !infile && i + 2 == process.argv.length) { forceFile = infile = process.argv[++i]; } + else if (arg == "--locations") { options.locations = true; } + else if (arg == "--allow-hash-bang") { options.allowHashBang = true; } + else if (arg == "--silent") { silent = true; } + else if (arg == "--compact") { compact = true; } + else if (arg == "--help") { help(0); } + else if (arg == "--tokenize") { tokenize = true; } + else if (arg == "--module") { options.sourceType = "module"; } + else { + var match = arg.match(/^--ecma(\d+)$/); + if (match) + { options.ecmaVersion = +match[1]; } + else + { help(1); } + } +} + +function run(code) { + var result; + try { + if (!tokenize) { + result = acorn.parse(code, options); + } else { + result = []; + var tokenizer$$1 = acorn.tokenizer(code, options), token; + do { + token = tokenizer$$1.getToken(); + result.push(token); + } while (token.type != acorn.tokTypes.eof) + } + } catch (e) { + console.error(e.message); + process.exit(1); + } + if (!silent) { console.log(JSON.stringify(result, null, compact ? null : 2)); } +} + +if (forceFile || infile && infile != "-") { + run(fs.readFileSync(infile, "utf8")); +} else { + var code = ""; + process.stdin.resume(); + process.stdin.on("data", function (chunk) { return code += chunk; }); + process.stdin.on("end", function () { return run(code); }); +} diff --git a/node_modules/acorn/bin/acorn b/node_modules/acorn/bin/acorn new file mode 100755 index 0000000..03888d0 --- /dev/null +++ b/node_modules/acorn/bin/acorn @@ -0,0 +1,4 @@ +#!/usr/bin/env node +'use strict'; + +require('./_acorn.js'); diff --git a/node_modules/acorn/bin/run_test262.js b/node_modules/acorn/bin/run_test262.js new file mode 100644 index 0000000..f52a478 --- /dev/null +++ b/node_modules/acorn/bin/run_test262.js @@ -0,0 +1,22 @@ +const fs = require("fs") +const path = require("path") +const run = require("test262-parser-runner") +const parse = require("..").parse + +const unsupportedFeatures = [ + "BigInt", + "class-fields", + "class-fields-private", + "class-fields-public", + "numeric-separator-literal", + "optional-catch-binding" +]; + +run( + (content, {sourceType}) => parse(content, {sourceType, ecmaVersion: 9}), + { + testsDirectory: path.dirname(require.resolve("test262/package.json")), + skip: test => (test.attrs.features && unsupportedFeatures.some(f => test.attrs.features.includes(f))), + whitelist: fs.readFileSync("./bin/test262.whitelist", "utf8").split("\n").filter(v => v) + } +) diff --git a/node_modules/acorn/bin/test262.whitelist b/node_modules/acorn/bin/test262.whitelist new file mode 100644 index 0000000..b00d340 --- /dev/null +++ b/node_modules/acorn/bin/test262.whitelist @@ -0,0 +1,409 @@ +annexB/language/function-code/block-decl-func-no-skip-try.js (default) +annexB/language/function-code/block-decl-func-skip-early-err-block.js (default) +annexB/language/function-code/block-decl-func-skip-early-err.js (default) +annexB/language/function-code/block-decl-func-skip-early-err-switch.js (default) +annexB/language/function-code/block-decl-func-skip-early-err-try.js (default) +annexB/language/function-code/if-decl-else-decl-a-func-no-skip-try.js (default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-block.js (default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err.js (default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-switch.js (default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-try.js (default) +annexB/language/function-code/if-decl-else-decl-b-func-no-skip-try.js (default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-block.js (default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err.js (default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-switch.js (default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-try.js (default) +annexB/language/function-code/if-decl-else-stmt-func-no-skip-try.js (default) +annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-block.js (default) +annexB/language/function-code/if-decl-else-stmt-func-skip-early-err.js (default) +annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-switch.js (default) +annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-try.js (default) +annexB/language/function-code/if-decl-no-else-func-no-skip-try.js (default) +annexB/language/function-code/if-decl-no-else-func-skip-early-err-block.js (default) +annexB/language/function-code/if-decl-no-else-func-skip-early-err.js (default) +annexB/language/function-code/if-decl-no-else-func-skip-early-err-switch.js (default) +annexB/language/function-code/if-decl-no-else-func-skip-early-err-try.js (default) +annexB/language/function-code/if-stmt-else-decl-func-no-skip-try.js (default) +annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-block.js (default) +annexB/language/function-code/if-stmt-else-decl-func-skip-early-err.js (default) +annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-switch.js (default) +annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-try.js (default) +annexB/language/function-code/switch-case-func-no-skip-try.js (default) +annexB/language/function-code/switch-case-func-skip-early-err-block.js (default) +annexB/language/function-code/switch-case-func-skip-early-err.js (default) +annexB/language/function-code/switch-case-func-skip-early-err-switch.js (default) +annexB/language/function-code/switch-case-func-skip-early-err-try.js (default) +annexB/language/function-code/switch-dflt-func-no-skip-try.js (default) +annexB/language/function-code/switch-dflt-func-skip-early-err-block.js (default) +annexB/language/function-code/switch-dflt-func-skip-early-err.js (default) +annexB/language/function-code/switch-dflt-func-skip-early-err-switch.js (default) +annexB/language/function-code/switch-dflt-func-skip-early-err-try.js (default) +annexB/language/global-code/block-decl-global-no-skip-try.js (default) +annexB/language/global-code/block-decl-global-skip-early-err-block.js (default) +annexB/language/global-code/block-decl-global-skip-early-err.js (default) +annexB/language/global-code/block-decl-global-skip-early-err-switch.js (default) +annexB/language/global-code/block-decl-global-skip-early-err-try.js (default) +annexB/language/global-code/if-decl-else-decl-a-global-no-skip-try.js (default) +annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-block.js (default) +annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err.js (default) +annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-switch.js (default) +annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-try.js (default) +annexB/language/global-code/if-decl-else-decl-b-global-no-skip-try.js (default) +annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-block.js (default) +annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err.js (default) +annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-switch.js (default) +annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-try.js (default) +annexB/language/global-code/if-decl-else-stmt-global-no-skip-try.js (default) +annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-block.js (default) +annexB/language/global-code/if-decl-else-stmt-global-skip-early-err.js (default) +annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-switch.js (default) +annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-try.js (default) +annexB/language/global-code/if-decl-no-else-global-no-skip-try.js (default) +annexB/language/global-code/if-decl-no-else-global-skip-early-err-block.js (default) +annexB/language/global-code/if-decl-no-else-global-skip-early-err.js (default) +annexB/language/global-code/if-decl-no-else-global-skip-early-err-switch.js (default) +annexB/language/global-code/if-decl-no-else-global-skip-early-err-try.js (default) +annexB/language/global-code/if-stmt-else-decl-global-no-skip-try.js (default) +annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-block.js (default) +annexB/language/global-code/if-stmt-else-decl-global-skip-early-err.js (default) +annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-switch.js (default) +annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-try.js (default) +annexB/language/global-code/switch-case-global-no-skip-try.js (default) +annexB/language/global-code/switch-case-global-skip-early-err-block.js (default) +annexB/language/global-code/switch-case-global-skip-early-err.js (default) +annexB/language/global-code/switch-case-global-skip-early-err-switch.js (default) +annexB/language/global-code/switch-case-global-skip-early-err-try.js (default) +annexB/language/global-code/switch-dflt-global-no-skip-try.js (default) +annexB/language/global-code/switch-dflt-global-skip-early-err-block.js (default) +annexB/language/global-code/switch-dflt-global-skip-early-err.js (default) +annexB/language/global-code/switch-dflt-global-skip-early-err-switch.js (default) +annexB/language/global-code/switch-dflt-global-skip-early-err-try.js (default) +annexB/language/statements/try/catch-redeclared-for-in-var.js (default) +annexB/language/statements/try/catch-redeclared-for-in-var.js (strict mode) +annexB/language/statements/try/catch-redeclared-for-var.js (default) +annexB/language/statements/try/catch-redeclared-for-var.js (strict mode) +annexB/language/statements/try/catch-redeclared-var-statement-captured.js (default) +annexB/language/statements/try/catch-redeclared-var-statement-captured.js (strict mode) +annexB/language/statements/try/catch-redeclared-var-statement.js (default) +annexB/language/statements/try/catch-redeclared-var-statement.js (strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/expressions/async-arrow-function/early-errors-arrow-await-in-formals-default.js (default) +language/expressions/async-arrow-function/early-errors-arrow-await-in-formals-default.js (strict mode) +language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-call.js (default) +language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-call.js (strict mode) +language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-property.js (default) +language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-property.js (strict mode) +language/expressions/async-function/early-errors-expression-body-contains-super-call.js (default) +language/expressions/async-function/early-errors-expression-body-contains-super-call.js (strict mode) +language/expressions/async-function/early-errors-expression-body-contains-super-property.js (default) +language/expressions/async-function/early-errors-expression-body-contains-super-property.js (strict mode) +language/expressions/async-function/early-errors-expression-formals-contains-super-call.js (default) +language/expressions/async-function/early-errors-expression-formals-contains-super-call.js (strict mode) +language/expressions/async-function/early-errors-expression-formals-contains-super-property.js (default) +language/expressions/async-function/early-errors-expression-formals-contains-super-property.js (strict mode) +language/expressions/class/method-param-dflt-yield.js (default) +language/expressions/class/static-method-param-dflt-yield.js (default) +language/expressions/function/early-body-super-call.js (default) +language/expressions/function/early-body-super-call.js (strict mode) +language/expressions/function/early-body-super-prop.js (default) +language/expressions/function/early-body-super-prop.js (strict mode) +language/expressions/function/early-params-super-call.js (default) +language/expressions/function/early-params-super-call.js (strict mode) +language/expressions/function/early-params-super-prop.js (default) +language/expressions/function/early-params-super-prop.js (strict mode) +language/expressions/object/method-definition/early-errors-object-method-body-contains-super-call.js (default) +language/expressions/object/method-definition/early-errors-object-method-body-contains-super-call.js (strict mode) +language/expressions/object/method-definition/early-errors-object-method-duplicate-parameters.js (default) +language/expressions/object/method-definition/early-errors-object-method-formals-contains-super-call.js (default) +language/expressions/object/method-definition/early-errors-object-method-formals-contains-super-call.js (strict mode) +language/expressions/object/method-definition/generator-super-call-body.js (default) +language/expressions/object/method-definition/generator-super-call-body.js (strict mode) +language/expressions/object/method-definition/generator-super-call-param.js (default) +language/expressions/object/method-definition/generator-super-call-param.js (strict mode) +language/expressions/object/prop-def-invalid-async-prefix.js (default) +language/expressions/object/prop-def-invalid-async-prefix.js (strict mode) +language/expressions/yield/in-iteration-stmt.js (default) +language/expressions/yield/in-iteration-stmt.js (strict mode) +language/expressions/yield/star-in-iteration-stmt.js (default) +language/expressions/yield/star-in-iteration-stmt.js (strict mode) +language/global-code/new.target-arrow.js (default) +language/global-code/new.target-arrow.js (strict mode) +language/global-code/super-call-arrow.js (default) +language/global-code/super-call-arrow.js (strict mode) +language/global-code/super-prop-arrow.js (default) +language/global-code/super-prop-arrow.js (strict mode) +language/module-code/early-export-global.js (default) +language/module-code/early-export-global.js (strict mode) +language/module-code/early-export-unresolvable.js (default) +language/module-code/early-export-unresolvable.js (strict mode) +language/module-code/parse-err-hoist-lex-fun.js (default) +language/module-code/parse-err-hoist-lex-fun.js (strict mode) +language/module-code/parse-err-hoist-lex-gen.js (default) +language/module-code/parse-err-hoist-lex-gen.js (strict mode) +language/statements/async-function/early-errors-declaration-body-contains-super-call.js (default) +language/statements/async-function/early-errors-declaration-body-contains-super-call.js (strict mode) +language/statements/async-function/early-errors-declaration-body-contains-super-property.js (default) +language/statements/async-function/early-errors-declaration-body-contains-super-property.js (strict mode) +language/statements/async-function/early-errors-declaration-formals-contains-super-call.js (default) +language/statements/async-function/early-errors-declaration-formals-contains-super-call.js (strict mode) +language/statements/async-function/early-errors-declaration-formals-contains-super-property.js (default) +language/statements/async-function/early-errors-declaration-formals-contains-super-property.js (strict mode) +language/expressions/async-generator/early-errors-expression-body-contains-super-call.js (default) +language/expressions/async-generator/early-errors-expression-body-contains-super-call.js (strict mode) +language/expressions/async-generator/early-errors-expression-body-contains-super-property.js (default) +language/expressions/async-generator/early-errors-expression-body-contains-super-property.js (strict mode) +language/expressions/async-generator/early-errors-expression-formals-contains-super-call.js (default) +language/expressions/async-generator/early-errors-expression-formals-contains-super-call.js (strict mode) +language/expressions/async-generator/early-errors-expression-formals-contains-super-property.js (default) +language/expressions/async-generator/early-errors-expression-formals-contains-super-property.js (strict mode) +language/statements/class/definition/early-errors-class-method-arguments-in-formal-parameters.js (default) +language/statements/class/definition/early-errors-class-method-body-contains-super-call.js (default) +language/statements/class/definition/early-errors-class-method-body-contains-super-call.js (strict mode) +language/statements/class/definition/early-errors-class-method-duplicate-parameters.js (default) +language/statements/class/definition/early-errors-class-method-eval-in-formal-parameters.js (default) +language/statements/class/definition/early-errors-class-method-formals-contains-super-call.js (default) +language/statements/class/definition/early-errors-class-method-formals-contains-super-call.js (strict mode) +language/statements/class/definition/methods-gen-yield-as-function-expression-binding-identifier.js (default) +language/statements/class/definition/methods-gen-yield-as-identifier-in-nested-function.js (default) +language/statements/class/method-param-yield.js (default) +language/statements/class/static-method-param-yield.js (default) +language/statements/class/strict-mode/with.js (default) +language/statements/class/syntax/early-errors/class-body-has-direct-super-missing-class-heritage.js (default) +language/statements/class/syntax/early-errors/class-body-has-direct-super-missing-class-heritage.js (strict mode) +language/statements/class/syntax/early-errors/class-body-method-contains-direct-super.js (default) +language/statements/class/syntax/early-errors/class-body-method-contains-direct-super.js (strict mode) +language/statements/class/syntax/early-errors/class-body-special-method-generator-contains-direct-super.js (default) +language/statements/class/syntax/early-errors/class-body-special-method-generator-contains-direct-super.js (strict mode) +language/statements/class/syntax/early-errors/class-body-special-method-get-contains-direct-super.js (default) +language/statements/class/syntax/early-errors/class-body-special-method-get-contains-direct-super.js (strict mode) +language/statements/class/syntax/early-errors/class-body-special-method-set-contains-direct-super.js (default) +language/statements/class/syntax/early-errors/class-body-special-method-set-contains-direct-super.js (strict mode) +language/statements/class/syntax/early-errors/class-body-static-method-contains-direct-super.js (default) +language/statements/class/syntax/early-errors/class-body-static-method-contains-direct-super.js (strict mode) +language/statements/class/syntax/early-errors/class-body-static-method-get-contains-direct-super.js (default) +language/statements/class/syntax/early-errors/class-body-static-method-get-contains-direct-super.js (strict mode) +language/statements/class/syntax/early-errors/class-body-static-method-set-contains-direct-super.js (default) +language/statements/class/syntax/early-errors/class-body-static-method-set-contains-direct-super.js (strict mode) +language/statements/class/syntax/early-errors/class-definition-evaluation-block-duplicate-binding.js (default) +language/statements/class/syntax/early-errors/class-definition-evaluation-block-duplicate-binding.js (strict mode) +language/statements/class/syntax/early-errors/class-definition-evaluation-scriptbody-duplicate-binding.js (default) +language/statements/class/syntax/early-errors/class-definition-evaluation-scriptbody-duplicate-binding.js (strict mode) +language/statements/const/syntax/const-declaring-let-split-across-two-lines.js (default) +language/statements/do-while/labelled-fn-stmt.js (default) +language/statements/for/head-let-bound-names-in-stmt.js (default) +language/statements/for/head-let-bound-names-in-stmt.js (strict mode) +language/statements/for-in/head-const-bound-names-in-stmt.js (default) +language/statements/for-in/head-const-bound-names-in-stmt.js (strict mode) +language/statements/for-in/head-const-bound-names-let.js (default) +language/statements/for-in/head-let-bound-names-in-stmt.js (default) +language/statements/for-in/head-let-bound-names-in-stmt.js (strict mode) +language/statements/for-in/head-let-bound-names-let.js (default) +language/statements/for-in/labelled-fn-stmt-const.js (default) +language/statements/for-in/labelled-fn-stmt-let.js (default) +language/statements/for-in/labelled-fn-stmt-lhs.js (default) +language/statements/for-in/labelled-fn-stmt-var.js (default) +language/statements/for-in/let-block-with-newline.js (default) +language/statements/for-in/let-identifier-with-newline.js (default) +language/statements/for/labelled-fn-stmt-expr.js (default) +language/statements/for/labelled-fn-stmt-let.js (default) +language/statements/for/labelled-fn-stmt-var.js (default) +language/statements/for/let-block-with-newline.js (default) +language/statements/for/let-identifier-with-newline.js (default) +language/statements/for-of/head-const-bound-names-in-stmt.js (default) +language/statements/for-of/head-const-bound-names-in-stmt.js (strict mode) +language/statements/for-of/head-const-bound-names-let.js (default) +language/statements/for-of/head-let-bound-names-in-stmt.js (default) +language/statements/for-of/head-let-bound-names-in-stmt.js (strict mode) +language/statements/for-of/head-let-bound-names-let.js (default) +language/statements/for-of/labelled-fn-stmt-const.js (default) +language/statements/for-of/labelled-fn-stmt-let.js (default) +language/statements/for-of/labelled-fn-stmt-lhs.js (default) +language/statements/for-of/labelled-fn-stmt-var.js (default) +language/statements/for-of/let-block-with-newline.js (default) +language/statements/for-of/let-identifier-with-newline.js (default) +language/statements/for-await-of/let-block-with-newline.js (default) +language/statements/for-await-of/let-identifier-with-newline.js (default) +language/statements/function/early-body-super-call.js (default) +language/statements/function/early-body-super-call.js (strict mode) +language/statements/function/early-body-super-prop.js (default) +language/statements/function/early-body-super-prop.js (strict mode) +language/statements/function/early-params-super-call.js (default) +language/statements/function/early-params-super-call.js (strict mode) +language/statements/function/early-params-super-prop.js (default) +language/statements/function/early-params-super-prop.js (strict mode) +language/statements/if/if-gen-else-gen.js (default) +language/statements/if/if-gen-else-stmt.js (default) +language/statements/if/if-gen-no-else.js (default) +language/statements/if/if-stmt-else-gen.js (default) +language/statements/if/labelled-fn-stmt-first.js (default) +language/statements/if/labelled-fn-stmt-lone.js (default) +language/statements/if/labelled-fn-stmt-second.js (default) +language/statements/if/let-block-with-newline.js (default) +language/statements/if/let-identifier-with-newline.js (default) +language/statements/labeled/decl-async-function.js (default) +language/statements/labeled/let-block-with-newline.js (default) +language/statements/labeled/let-identifier-with-newline.js (default) +language/statements/let/syntax/identifier-let-disallowed-as-boundname.js (default) +language/statements/let/syntax/let-let-declaration-split-across-two-lines.js (default) +language/statements/let/syntax/let-let-declaration-with-initializer-split-across-two-lines.js (default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js (strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js (strict mode) +language/statements/while/labelled-fn-stmt.js (default) +language/statements/while/let-block-with-newline.js (default) +language/statements/while/let-identifier-with-newline.js (default) +language/statements/with/labelled-fn-stmt.js (default) +language/statements/with/let-block-with-newline.js (default) +language/statements/with/let-identifier-with-newline.js (default) +language/white-space/mongolian-vowel-separator.js (default) +language/white-space/mongolian-vowel-separator.js (strict mode) diff --git a/node_modules/acorn/dist/.keep b/node_modules/acorn/dist/.keep new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/acorn/dist/acorn.es.js b/node_modules/acorn/dist/acorn.es.js new file mode 100644 index 0000000..c272a9d --- /dev/null +++ b/node_modules/acorn/dist/acorn.es.js @@ -0,0 +1,5305 @@ +// Reserved word lists for various dialects of the language + +var reservedWords = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" +}; + +// And the keywords + +var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; + +var keywords = { + 5: ecma5AndLessKeywords, + 6: ecma5AndLessKeywords + " const class extends export import super" +}; + +var keywordRelationalOperator = /^in(stanceof)?$/; + +// ## Character categories + +// Big ugly regular expressions that match characters in the +// whitespace, identifier, and identifier-start categories. These +// are only applied when a character is found to actually have a +// code point above 128. +// Generated by `bin/generate-identifier-regex.js`. + +var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312e\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fea\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ae\ua7b0-\ua7b7\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d4-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + +var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + +// These are a run-length and offset encoded representation of the +// >0xffff code points that are a valid part of identifiers. The +// offset starts at 0x10000, and each pair of numbers represents an +// offset to the next range, and then a size of the range. They were +// generated by bin/generate-identifier-regex.js + +// eslint-disable-next-line comma-spacing +var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,55,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,698,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,1,31,6124,20,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541]; + +// eslint-disable-next-line comma-spacing +var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,19719,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239]; + +// This has a complexity linear to the value of the code. The +// assumption is that looking up astral identifier characters is +// rare. +function isInAstralSet(code, set) { + var pos = 0x10000; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) { return false } + pos += set[i + 1]; + if (pos >= code) { return true } + } +} + +// Test whether a given character code starts an identifier. + +function isIdentifierStart(code, astral) { + if (code < 65) { return code === 36 } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) +} + +// Test whether a given character is part of an identifier. + +function isIdentifierChar(code, astral) { + if (code < 48) { return code === 36 } + if (code < 58) { return true } + if (code < 65) { return false } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) +} + +// ## Token types + +// The assignment of fine-grained, information-carrying type objects +// allows the tokenizer to store the information it has about a +// token in a way that is very cheap for the parser to look up. + +// All token type variables start with an underscore, to make them +// easy to recognize. + +// The `beforeExpr` property is used to disambiguate between regular +// expressions and divisions. It is set on all token types that can +// be followed by an expression (thus, a slash after them would be a +// regular expression). +// +// The `startsExpr` property is used to check if the token ends a +// `yield` expression. It is set on all token types that either can +// directly start an expression (like a quotation mark) or can +// continue an expression (like the body of a string). +// +// `isLoop` marks a keyword as starting a loop, which is important +// to know when parsing a label, in order to allow or disallow +// continue jumps to that label. + +var TokenType = function TokenType(label, conf) { + if ( conf === void 0 ) conf = {}; + + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; +}; + +function binop(name, prec) { + return new TokenType(name, {beforeExpr: true, binop: prec}) +} +var beforeExpr = {beforeExpr: true}; +var startsExpr = {startsExpr: true}; + +// Map keyword names to token types. + +var keywords$1 = {}; + +// Succinct definitions of keyword token types +function kw(name, options) { + if ( options === void 0 ) options = {}; + + options.keyword = name; + return keywords$1[name] = new TokenType(name, options) +} + +var types = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + eof: new TokenType("eof"), + + // Punctuation token types. + bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), + bracketR: new TokenType("]"), + braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), + braceR: new TokenType("}"), + parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), + + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + + eq: new TokenType("=", {beforeExpr: true, isAssign: true}), + assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), + incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), + prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", {beforeExpr: true}), + + // Keyword token types. + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", {isLoop: true, beforeExpr: true}), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", {isLoop: true}), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", {isLoop: true}), + _with: kw("with"), + _new: kw("new", {beforeExpr: true, startsExpr: true}), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import"), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", {beforeExpr: true, binop: 7}), + _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), + _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), + _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), + _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) +}; + +// Matches a whole line break (where CRLF is considered a single +// line break). Used to count lines. + +var lineBreak = /\r\n?|\n|\u2028|\u2029/; +var lineBreakG = new RegExp(lineBreak.source, "g"); + +function isNewLine(code) { + return code === 10 || code === 13 || code === 0x2028 || code === 0x2029 +} + +var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; + +var ref = Object.prototype; +var hasOwnProperty = ref.hasOwnProperty; +var toString = ref.toString; + +// Checks if an object has a property. + +function has(obj, propName) { + return hasOwnProperty.call(obj, propName) +} + +var isArray = Array.isArray || (function (obj) { return ( + toString.call(obj) === "[object Array]" +); }); + +// These are used when `options.locations` is on, for the +// `startLoc` and `endLoc` properties. + +var Position = function Position(line, col) { + this.line = line; + this.column = col; +}; + +Position.prototype.offset = function offset (n) { + return new Position(this.line, this.column + n) +}; + +var SourceLocation = function SourceLocation(p, start, end) { + this.start = start; + this.end = end; + if (p.sourceFile !== null) { this.source = p.sourceFile; } +}; + +// The `getLineInfo` function is mostly useful when the +// `locations` option is off (for performance reasons) and you +// want to find the line/column position for a given character +// offset. `input` should be the code string that the offset refers +// into. + +function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreakG.lastIndex = cur; + var match = lineBreakG.exec(input); + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else { + return new Position(line, offset - cur) + } + } +} + +// A second optional argument can be given to further configure +// the parser process. These options are recognized: + +var defaultOptions = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must + // be either 3, 5, 6 (2015), 7 (2016), or 8 (2017). This influences support + // for strict mode, the set of reserved words, and support for + // new syntax features. The default is 7. + ecmaVersion: 7, + // `sourceType` indicates the mode the code should be parsed in. + // Can be either `"script"` or `"module"`. This influences global + // strict mode and parsing of `import` and `export` declarations. + sourceType: "script", + // `onInsertedSemicolon` can be a callback that will be called + // when a semicolon is automatically inserted. It will be passed + // th position of the comma as an offset, and if `locations` is + // enabled, it is given the location as a `{line, column}` object + // as second argument. + onInsertedSemicolon: null, + // `onTrailingComma` is similar to `onInsertedSemicolon`, but for + // trailing commas. + onTrailingComma: null, + // By default, reserved words are only enforced if ecmaVersion >= 5. + // Set `allowReserved` to a boolean value to explicitly turn this on + // an off. When this option has the value "never", reserved words + // and keywords can also not be used as property names. + allowReserved: null, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // When enabled, hashbang directive in the beginning of file + // is allowed and treated as a line comment. + allowHashBang: false, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // A function can be passed as `onToken` option, which will + // cause Acorn to call that function with object in the same + // format as tokens returned from `tokenizer().getToken()`. Note + // that you are not allowed to call the parser from the + // callback—that will corrupt its internal state. + onToken: null, + // A function can be passed as `onComment` option, which will + // cause Acorn to call that function with `(block, text, start, + // end)` parameters whenever a comment is skipped. `block` is a + // boolean indicating whether this is a block (`/* */`) comment, + // `text` is the content of the comment, and `start` and `end` are + // character offsets that denote the start and end of the comment. + // When the `locations` option is on, two more parameters are + // passed, the full `{line, column}` locations of the start and + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. + onComment: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `locations` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null, + // This value, if given, is stored in every node, whether + // `locations` is on or off. + directSourceFile: null, + // When enabled, parenthesized expressions are represented by + // (non-standard) ParenthesizedExpression nodes + preserveParens: false, + plugins: {} +}; + +// Interpret and default an options object + +function getOptions(opts) { + var options = {}; + + for (var opt in defaultOptions) + { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } + + if (options.ecmaVersion >= 2015) + { options.ecmaVersion -= 2009; } + + if (options.allowReserved == null) + { options.allowReserved = options.ecmaVersion < 5; } + + if (isArray(options.onToken)) { + var tokens = options.onToken; + options.onToken = function (token) { return tokens.push(token); }; + } + if (isArray(options.onComment)) + { options.onComment = pushComment(options, options.onComment); } + + return options +} + +function pushComment(options, array) { + return function(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text, + start: start, + end: end + }; + if (options.locations) + { comment.loc = new SourceLocation(this, startLoc, endLoc); } + if (options.ranges) + { comment.range = [start, end]; } + array.push(comment); + } +} + +// Registered plugins +var plugins = {}; + +function keywordRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") +} + +var Parser = function Parser(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = keywordRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]); + var reserved = ""; + if (!options.allowReserved) { + for (var v = options.ecmaVersion;; v--) + { if (reserved = reservedWords[v]) { break } } + if (options.sourceType == "module") { reserved += " await"; } + } + this.reservedWords = keywordRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = keywordRegexp(reservedStrict); + this.reservedWordsStrictBind = keywordRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); + + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + this.containsEsc = false; + + // Load plugins + this.loadPlugins(options.plugins); + + // Set up token state + + // The current position of the tokenizer in the input. + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + + // Properties of the current token: + // Its type + this.type = types.eof; + // For tokens that include more information than their type, the value + this.value = null; + // Its start and end offset + this.start = this.end = this.pos; + // And, if locations are used, the {line, column} object + // corresponding to those offsets + this.startLoc = this.endLoc = this.curPosition(); + + // Position information for the previous token + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + this.context = this.initialContext(); + this.exprAllowed = true; + + // Figure out if it's a module code. + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + + // Used to signify the start of a potential arrow function + this.potentialArrowAt = -1; + + // Flags to track whether we are in a function, a generator, an async function. + this.inFunction = this.inGenerator = this.inAsync = false; + // Positions to delayed-check that yield/await does not exist in default parameters. + this.yieldPos = this.awaitPos = 0; + // Labels in scope. + this.labels = []; + + // If enabled, skip leading hashbang line. + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") + { this.skipLineComment(2); } + + // Scope tracking for duplicate variable names (see scope.js) + this.scopeStack = []; + this.enterFunctionScope(); + + // For RegExp validation + this.regexpState = null; +}; + +// DEPRECATED Kept for backwards compatibility until 3.0 in case a plugin uses them +Parser.prototype.isKeyword = function isKeyword (word) { return this.keywords.test(word) }; +Parser.prototype.isReservedWord = function isReservedWord (word) { return this.reservedWords.test(word) }; + +Parser.prototype.extend = function extend (name, f) { + this[name] = f(this[name]); +}; + +Parser.prototype.loadPlugins = function loadPlugins (pluginConfigs) { + var this$1 = this; + + for (var name in pluginConfigs) { + var plugin = plugins[name]; + if (!plugin) { throw new Error("Plugin '" + name + "' not found") } + plugin(this$1, pluginConfigs[name]); + } +}; + +Parser.prototype.parse = function parse () { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node) +}; + +var pp = Parser.prototype; + +// ## Parser utilities + +var literal = /^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)"|;)/; +pp.strictDirective = function(start) { + var this$1 = this; + + for (;;) { + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this$1.input)[0].length; + var match = literal.exec(this$1.input.slice(start)); + if (!match) { return false } + if ((match[1] || match[2]) == "use strict") { return true } + start += match[0].length; + } +}; + +// Predicate that tests whether the next token is of the given +// type, and if yes, consumes it as a side effect. + +pp.eat = function(type) { + if (this.type === type) { + this.next(); + return true + } else { + return false + } +}; + +// Tests whether parsed token is a contextual keyword. + +pp.isContextual = function(name) { + return this.type === types.name && this.value === name && !this.containsEsc +}; + +// Consumes contextual keyword if possible. + +pp.eatContextual = function(name) { + if (!this.isContextual(name)) { return false } + this.next(); + return true +}; + +// Asserts that following token is given contextual keyword. + +pp.expectContextual = function(name) { + if (!this.eatContextual(name)) { this.unexpected(); } +}; + +// Test whether a semicolon can be inserted at the current position. + +pp.canInsertSemicolon = function() { + return this.type === types.eof || + this.type === types.braceR || + lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) +}; + +pp.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) + { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } + return true + } +}; + +// Consume a semicolon, or, failing that, see if we are allowed to +// pretend that there is a semicolon at this position. + +pp.semicolon = function() { + if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } +}; + +pp.afterTrailingComma = function(tokType, notNext) { + if (this.type == tokType) { + if (this.options.onTrailingComma) + { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } + if (!notNext) + { this.next(); } + return true + } +}; + +// Expect a token of a given type. If found, consume it, otherwise, +// raise an unexpected token error. + +pp.expect = function(type) { + this.eat(type) || this.unexpected(); +}; + +// Raise an unexpected token error. + +pp.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); +}; + +function DestructuringErrors() { + this.shorthandAssign = + this.trailingComma = + this.parenthesizedAssign = + this.parenthesizedBind = + this.doubleProto = + -1; +} + +pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { return } + if (refDestructuringErrors.trailingComma > -1) + { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } +}; + +pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { return false } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } + if (shorthandAssign >= 0) + { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } + if (doubleProto >= 0) + { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } +}; + +pp.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) + { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } + if (this.awaitPos) + { this.raise(this.awaitPos, "Await expression cannot be a default value"); } +}; + +pp.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") + { return this.isSimpleAssignTarget(expr.expression) } + return expr.type === "Identifier" || expr.type === "MemberExpression" +}; + +var pp$1 = Parser.prototype; + +// ### Statement parsing + +// Parse a program. Initializes the parser, reads any number of +// statements, and wraps them in a Program node. Optionally takes a +// `program` argument. If present, the statements will be appended +// to its body instead of creating a new node. + +pp$1.parseTopLevel = function(node) { + var this$1 = this; + + var exports = {}; + if (!node.body) { node.body = []; } + while (this.type !== types.eof) { + var stmt = this$1.parseStatement(true, true, exports); + node.body.push(stmt); + } + this.adaptDirectivePrologue(node.body); + this.next(); + if (this.options.ecmaVersion >= 6) { + node.sourceType = this.options.sourceType; + } + return this.finishNode(node, "Program") +}; + +var loopLabel = {kind: "loop"}; +var switchLabel = {kind: "switch"}; + +pp$1.isLet = function() { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 91 || nextCh == 123) { return true } // '{' and '[' + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { return true } + } + return false +}; + +// check 'async [no LineTerminator here] function' +// - 'async /*foo*/ function' is OK. +// - 'async /*\n*/ function' is invalid. +pp$1.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) + { return false } + + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length; + return !lineBreak.test(this.input.slice(this.pos, next)) && + this.input.slice(next, next + 8) === "function" && + (next + 8 == this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) +}; + +// Parse a single statement. +// +// If expecting a statement and finding a slash operator, parse a +// regular expression literal. This is to handle cases like +// `if (foo) /blah/.exec(foo)`, where looking at the previous token +// does not help. + +pp$1.parseStatement = function(declaration, topLevel, exports) { + var starttype = this.type, node = this.startNode(), kind; + + if (this.isLet()) { + starttype = types._var; + kind = "let"; + } + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types._debugger: return this.parseDebuggerStatement(node) + case types._do: return this.parseDoStatement(node) + case types._for: return this.parseForStatement(node) + case types._function: + if (!declaration && this.options.ecmaVersion >= 6) { this.unexpected(); } + return this.parseFunctionStatement(node, false) + case types._class: + if (!declaration) { this.unexpected(); } + return this.parseClass(node, true) + case types._if: return this.parseIfStatement(node) + case types._return: return this.parseReturnStatement(node) + case types._switch: return this.parseSwitchStatement(node) + case types._throw: return this.parseThrowStatement(node) + case types._try: return this.parseTryStatement(node) + case types._const: case types._var: + kind = kind || this.value; + if (!declaration && kind != "var") { this.unexpected(); } + return this.parseVarStatement(node, kind) + case types._while: return this.parseWhileStatement(node) + case types._with: return this.parseWithStatement(node) + case types.braceL: return this.parseBlock() + case types.semi: return this.parseEmptyStatement(node) + case types._export: + case types._import: + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) + { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } + if (!this.inModule) + { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } + } + return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + default: + if (this.isAsyncFunction()) { + if (!declaration) { this.unexpected(); } + this.next(); + return this.parseFunctionStatement(node, true) + } + + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + { return this.parseLabeledStatement(node, maybeName, expr) } + else { return this.parseExpressionStatement(node, expr) } + } +}; + +pp$1.parseBreakContinueStatement = function(node, keyword) { + var this$1 = this; + + var isBreak = keyword == "break"; + this.next(); + if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types.name) { this.unexpected(); } + else { + node.label = this.parseIdent(); + this.semicolon(); + } + + // Verify that there is an actual destination to break or + // continue to. + var i = 0; + for (; i < this.labels.length; ++i) { + var lab = this$1.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } + if (node.label && isBreak) { break } + } + } + if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") +}; + +pp$1.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement") +}; + +pp$1.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement(false); + this.labels.pop(); + this.expect(types._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) + { this.eat(types.semi); } + else + { this.semicolon(); } + return this.finishNode(node, "DoWhileStatement") +}; + +// Disambiguating between a `for` and a `for`/`in` or `for`/`of` +// loop is non-trivial. Basically, we have to parse the init `var` +// statement or expression, disallowing the `in` operator (see +// the second parameter to `parseExpression`), and then check +// whether the next token is `in` or `of`. When there is no init +// part (semicolon immediately after the opening parenthesis), it +// is a regular `for` loop. + +pp$1.parseForStatement = function(node) { + this.next(); + var awaitAt = (this.options.ecmaVersion >= 9 && this.inAsync && this.eatContextual("await")) ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterLexicalScope(); + this.expect(types.parenL); + if (this.type === types.semi) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, null) + } + var isLet = this.isLet(); + if (this.type === types._var || this.type === types._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1 && + !(kind !== "var" && init$1.declarations[0].init)) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + return this.parseForIn(node, init$1) + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init$1) + } + var refDestructuringErrors = new DestructuringErrors; + var init = this.parseExpression(true, refDestructuringErrors); + if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLVal(init); + return this.parseForIn(node, init) + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init) +}; + +pp$1.parseFunctionStatement = function(node, isAsync) { + this.next(); + return this.parseFunction(node, true, false, isAsync) +}; + +pp$1.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + // allow function declarations in branches, but only in non-strict mode + node.consequent = this.parseStatement(!this.strict && this.type == types._function); + node.alternate = this.eat(types._else) ? this.parseStatement(!this.strict && this.type == types._function) : null; + return this.finishNode(node, "IfStatement") +}; + +pp$1.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) + { this.raise(this.start, "'return' outside of function"); } + this.next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + else { node.argument = this.parseExpression(); this.semicolon(); } + return this.finishNode(node, "ReturnStatement") +}; + +pp$1.parseSwitchStatement = function(node) { + var this$1 = this; + + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types.braceL); + this.labels.push(switchLabel); + this.enterLexicalScope(); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + var cur; + for (var sawDefault = false; this.type != types.braceR;) { + if (this$1.type === types._case || this$1.type === types._default) { + var isCase = this$1.type === types._case; + if (cur) { this$1.finishNode(cur, "SwitchCase"); } + node.cases.push(cur = this$1.startNode()); + cur.consequent = []; + this$1.next(); + if (isCase) { + cur.test = this$1.parseExpression(); + } else { + if (sawDefault) { this$1.raiseRecoverable(this$1.lastTokStart, "Multiple default clauses"); } + sawDefault = true; + cur.test = null; + } + this$1.expect(types.colon); + } else { + if (!cur) { this$1.unexpected(); } + cur.consequent.push(this$1.parseStatement(true)); + } + } + this.exitLexicalScope(); + if (cur) { this.finishNode(cur, "SwitchCase"); } + this.next(); // Closing brace + this.labels.pop(); + return this.finishNode(node, "SwitchStatement") +}; + +pp$1.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) + { this.raise(this.lastTokEnd, "Illegal newline after throw"); } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement") +}; + +// Reused empty array added for node fields that are always empty. + +var empty = []; + +pp$1.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types._catch) { + var clause = this.startNode(); + this.next(); + this.expect(types.parenL); + clause.param = this.parseBindingAtom(); + this.enterLexicalScope(); + this.checkLVal(clause.param, "let"); + this.expect(types.parenR); + clause.body = this.parseBlock(false); + this.exitLexicalScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) + { this.raise(node.start, "Missing catch or finally clause"); } + return this.finishNode(node, "TryStatement") +}; + +pp$1.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration") +}; + +pp$1.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement(false); + this.labels.pop(); + return this.finishNode(node, "WhileStatement") +}; + +pp$1.parseWithStatement = function(node) { + if (this.strict) { this.raise(this.start, "'with' in strict mode"); } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement(false); + return this.finishNode(node, "WithStatement") +}; + +pp$1.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement") +}; + +pp$1.parseLabeledStatement = function(node, maybeName, expr) { + var this$1 = this; + + for (var i$1 = 0, list = this$1.labels; i$1 < list.length; i$1 += 1) + { + var label = list[i$1]; + + if (label.name === maybeName) + { this$1.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } } + var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label$1 = this$1.labels[i]; + if (label$1.statementStart == node.start) { + // Update information about previous labels on this node + label$1.statementStart = this$1.start; + label$1.kind = kind; + } else { break } + } + this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); + node.body = this.parseStatement(true); + if (node.body.type == "ClassDeclaration" || + node.body.type == "VariableDeclaration" && node.body.kind != "var" || + node.body.type == "FunctionDeclaration" && (this.strict || node.body.generator)) + { this.raiseRecoverable(node.body.start, "Invalid labeled declaration"); } + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement") +}; + +pp$1.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement") +}; + +// Parse a semicolon-enclosed block of statements, handling `"use +// strict"` declarations when `allowStrict` is true (used for +// function bodies). + +pp$1.parseBlock = function(createNewLexicalScope) { + var this$1 = this; + if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; + + var node = this.startNode(); + node.body = []; + this.expect(types.braceL); + if (createNewLexicalScope) { + this.enterLexicalScope(); + } + while (!this.eat(types.braceR)) { + var stmt = this$1.parseStatement(true); + node.body.push(stmt); + } + if (createNewLexicalScope) { + this.exitLexicalScope(); + } + return this.finishNode(node, "BlockStatement") +}; + +// Parse a regular `for` loop. The disambiguation code in +// `parseStatement` will already have parsed the init statement or +// expression. + +pp$1.parseFor = function(node, init) { + node.init = init; + this.expect(types.semi); + node.test = this.type === types.semi ? null : this.parseExpression(); + this.expect(types.semi); + node.update = this.type === types.parenR ? null : this.parseExpression(); + this.expect(types.parenR); + this.exitLexicalScope(); + node.body = this.parseStatement(false); + this.labels.pop(); + return this.finishNode(node, "ForStatement") +}; + +// Parse a `for`/`in` and `for`/`of` loop, which are almost +// same from parser's perspective. + +pp$1.parseForIn = function(node, init) { + var type = this.type === types._in ? "ForInStatement" : "ForOfStatement"; + this.next(); + if (type == "ForInStatement") { + if (init.type === "AssignmentPattern" || + (init.type === "VariableDeclaration" && init.declarations[0].init != null && + (this.strict || init.declarations[0].id.type !== "Identifier"))) + { this.raise(init.start, "Invalid assignment in for-in loop head"); } + } + node.left = init; + node.right = type == "ForInStatement" ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types.parenR); + this.exitLexicalScope(); + node.body = this.parseStatement(false); + this.labels.pop(); + return this.finishNode(node, type) +}; + +// Parse a list of variable declarations. + +pp$1.parseVar = function(node, isFor, kind) { + var this$1 = this; + + node.declarations = []; + node.kind = kind; + for (;;) { + var decl = this$1.startNode(); + this$1.parseVarId(decl, kind); + if (this$1.eat(types.eq)) { + decl.init = this$1.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this$1.type === types._in || (this$1.options.ecmaVersion >= 6 && this$1.isContextual("of")))) { + this$1.unexpected(); + } else if (decl.id.type != "Identifier" && !(isFor && (this$1.type === types._in || this$1.isContextual("of")))) { + this$1.raise(this$1.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this$1.finishNode(decl, "VariableDeclarator")); + if (!this$1.eat(types.comma)) { break } + } + return node +}; + +pp$1.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(kind); + this.checkLVal(decl.id, kind, false); +}; + +// Parse a function declaration or literal (depending on the +// `isStatement` parameter). + +pp$1.parseFunction = function(node, isStatement, allowExpressionBody, isAsync) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) + { node.generator = this.eat(types.star); } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + if (isStatement) { + node.id = isStatement === "nullableID" && this.type != types.name ? null : this.parseIdent(); + if (node.id) { + this.checkLVal(node.id, "var"); + } + } + + var oldInGen = this.inGenerator, oldInAsync = this.inAsync, + oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldInFunc = this.inFunction; + this.inGenerator = node.generator; + this.inAsync = node.async; + this.yieldPos = 0; + this.awaitPos = 0; + this.inFunction = true; + this.enterFunctionScope(); + + if (!isStatement) + { node.id = this.type == types.name ? this.parseIdent() : null; } + + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody); + + this.inGenerator = oldInGen; + this.inAsync = oldInAsync; + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.inFunction = oldInFunc; + return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression") +}; + +pp$1.parseFunctionParams = function(node) { + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); +}; + +// Parse a class declaration or literal (depending on the +// `isStatement` parameter). + +pp$1.parseClass = function(node, isStatement) { + var this$1 = this; + + this.next(); + + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + var member = this$1.parseClassMember(classBody); + if (member && member.type === "MethodDefinition" && member.kind === "constructor") { + if (hadConstructor) { this$1.raise(member.start, "Duplicate constructor in the same class"); } + hadConstructor = true; + } + } + node.body = this.finishNode(classBody, "ClassBody"); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") +}; + +pp$1.parseClassMember = function(classBody) { + var this$1 = this; + + if (this.eat(types.semi)) { return null } + + var method = this.startNode(); + var tryContextual = function (k, noLineBreak) { + if ( noLineBreak === void 0 ) noLineBreak = false; + + var start = this$1.start, startLoc = this$1.startLoc; + if (!this$1.eatContextual(k)) { return false } + if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } + if (method.key) { this$1.unexpected(); } + method.computed = false; + method.key = this$1.startNodeAt(start, startLoc); + method.key.name = k; + this$1.finishNode(method.key, "Identifier"); + return false + }; + + method.kind = "method"; + method.static = tryContextual("static"); + var isGenerator = this.eat(types.star); + var isAsync = false; + if (!isGenerator) { + if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + } else if (tryContextual("get")) { + method.kind = "get"; + } else if (tryContextual("set")) { + method.kind = "set"; + } + } + if (!method.key) { this.parsePropertyName(method); } + var key = method.key; + if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || + key.type === "Literal" && key.value === "constructor")) { + if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } + if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } + if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } + method.kind = "constructor"; + } else if (method.static && key.type === "Identifier" && key.name === "prototype") { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + this.parseClassMethod(classBody, method, isGenerator, isAsync); + if (method.kind === "get" && method.value.params.length !== 0) + { this.raiseRecoverable(method.value.start, "getter should have no params"); } + if (method.kind === "set" && method.value.params.length !== 1) + { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } + if (method.kind === "set" && method.value.params[0].type === "RestElement") + { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } + return method +}; + +pp$1.parseClassMethod = function(classBody, method, isGenerator, isAsync) { + method.value = this.parseMethod(isGenerator, isAsync); + classBody.body.push(this.finishNode(method, "MethodDefinition")); +}; + +pp$1.parseClassId = function(node, isStatement) { + node.id = this.type === types.name ? this.parseIdent() : isStatement === true ? this.unexpected() : null; +}; + +pp$1.parseClassSuper = function(node) { + node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; +}; + +// Parses module export declaration. + +pp$1.parseExport = function(node, exports) { + var this$1 = this; + + this.next(); + // export * from '...' + if (this.eat(types.star)) { + this.expectContextual("from"); + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration") + } + if (this.eat(types._default)) { // export default ... + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { this.next(); } + node.declaration = this.parseFunction(fNode, "nullableID", false, isAsync); + } else if (this.type === types._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration") + } + // export var|const|let|function|class ... + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(true); + if (node.declaration.type === "VariableDeclaration") + { this.checkVariableExport(exports, node.declaration.declarations); } + else + { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } + node.specifiers = []; + node.source = null; + } else { // export { x, y as z } [from '...'] + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + } else { + // check for keywords used as local names + for (var i = 0, list = node.specifiers; i < list.length; i += 1) { + var spec = list[i]; + + this$1.checkUnreserved(spec.local); + } + + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration") +}; + +pp$1.checkExport = function(exports, name, pos) { + if (!exports) { return } + if (has(exports, name)) + { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } + exports[name] = true; +}; + +pp$1.checkPatternExport = function(exports, pat) { + var this$1 = this; + + var type = pat.type; + if (type == "Identifier") + { this.checkExport(exports, pat.name, pat.start); } + else if (type == "ObjectPattern") + { for (var i = 0, list = pat.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this$1.checkPatternExport(exports, prop); + } } + else if (type == "ArrayPattern") + { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + + if (elt) { this$1.checkPatternExport(exports, elt); } + } } + else if (type == "Property") + { this.checkPatternExport(exports, pat.value); } + else if (type == "AssignmentPattern") + { this.checkPatternExport(exports, pat.left); } + else if (type == "RestElement") + { this.checkPatternExport(exports, pat.argument); } + else if (type == "ParenthesizedExpression") + { this.checkPatternExport(exports, pat.expression); } +}; + +pp$1.checkVariableExport = function(exports, decls) { + var this$1 = this; + + if (!exports) { return } + for (var i = 0, list = decls; i < list.length; i += 1) + { + var decl = list[i]; + + this$1.checkPatternExport(exports, decl.id); + } +}; + +pp$1.shouldParseExportStatement = function() { + return this.type.keyword === "var" || + this.type.keyword === "const" || + this.type.keyword === "class" || + this.type.keyword === "function" || + this.isLet() || + this.isAsyncFunction() +}; + +// Parses a comma-separated list of module exports. + +pp$1.parseExportSpecifiers = function(exports) { + var this$1 = this; + + var nodes = [], first = true; + // export { x, y as z } [from '...'] + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node = this$1.startNode(); + node.local = this$1.parseIdent(true); + node.exported = this$1.eatContextual("as") ? this$1.parseIdent(true) : node.local; + this$1.checkExport(exports, node.exported.name, node.exported.start); + nodes.push(this$1.finishNode(node, "ExportSpecifier")); + } + return nodes +}; + +// Parses import declaration. + +pp$1.parseImport = function(node) { + this.next(); + // import '...' + if (this.type === types.string) { + node.specifiers = empty; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration") +}; + +// Parses a comma-separated list of module imports. + +pp$1.parseImportSpecifiers = function() { + var this$1 = this; + + var nodes = [], first = true; + if (this.type === types.name) { + // import defaultObj, { x, y as z } from '...' + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLVal(node.local, "let"); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types.comma)) { return nodes } + } + if (this.type === types.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLVal(node$1.local, "let"); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes + } + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node$2 = this$1.startNode(); + node$2.imported = this$1.parseIdent(true); + if (this$1.eatContextual("as")) { + node$2.local = this$1.parseIdent(); + } else { + this$1.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this$1.checkLVal(node$2.local, "let"); + nodes.push(this$1.finishNode(node$2, "ImportSpecifier")); + } + return nodes +}; + +// Set `ExpressionStatement#directive` property for directive prologues. +pp$1.adaptDirectivePrologue = function(statements) { + for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { + statements[i].directive = statements[i].expression.raw.slice(1, -1); + } +}; +pp$1.isDirectiveCandidate = function(statement) { + return ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + typeof statement.expression.value === "string" && + // Reject parenthesized strings. + (this.input[statement.start] === "\"" || this.input[statement.start] === "'") + ) +}; + +var pp$2 = Parser.prototype; + +// Convert existing expression atom to assignable pattern +// if possible. + +pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { + var this$1 = this; + + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") + { this.raise(node.start, "Can not use 'await' as identifier inside an async function"); } + break + + case "ObjectPattern": + case "ArrayPattern": + case "RestElement": + break + + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + + this$1.toAssignable(prop, isBinding); + // Early error: + // AssignmentRestProperty[Yield, Await] : + // `...` DestructuringAssignmentTarget[Yield, Await] + // + // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. + if ( + prop.type === "RestElement" && + (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") + ) { + this$1.raise(prop.argument.start, "Unexpected token"); + } + } + break + + case "Property": + // AssignmentProperty has type == "Property" + if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } + this.toAssignable(node.value, isBinding); + break + + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + this.toAssignableList(node.elements, isBinding); + break + + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") + { this.raise(node.argument.start, "Rest elements cannot have a default value"); } + break + + case "AssignmentExpression": + if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + // falls through to AssignmentPattern + + case "AssignmentPattern": + break + + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding); + break + + case "MemberExpression": + if (!isBinding) { break } + + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + return node +}; + +// Convert list of expression atoms to binding list. + +pp$2.toAssignableList = function(exprList, isBinding) { + var this$1 = this; + + var end = exprList.length; + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) { this$1.toAssignable(elt, isBinding); } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") + { this.unexpected(last.argument.start); } + } + return exprList +}; + +// Parses spread element. + +pp$2.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement") +}; + +pp$2.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + + // RestElement inside of a function parameter must be an identifier + if (this.options.ecmaVersion === 6 && this.type !== types.name) + { this.unexpected(); } + + node.argument = this.parseBindingAtom(); + + return this.finishNode(node, "RestElement") +}; + +// Parses lvalue (assignable) atom. + +pp$2.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types.bracketR, true, true); + return this.finishNode(node, "ArrayPattern") + + case types.braceL: + return this.parseObj(true) + } + } + return this.parseIdent() +}; + +pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var this$1 = this; + + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { first = false; } + else { this$1.expect(types.comma); } + if (allowEmpty && this$1.type === types.comma) { + elts.push(null); + } else if (allowTrailingComma && this$1.afterTrailingComma(close)) { + break + } else if (this$1.type === types.ellipsis) { + var rest = this$1.parseRestBinding(); + this$1.parseBindingListItem(rest); + elts.push(rest); + if (this$1.type === types.comma) { this$1.raise(this$1.start, "Comma is not permitted after the rest element"); } + this$1.expect(close); + break + } else { + var elem = this$1.parseMaybeDefault(this$1.start, this$1.startLoc); + this$1.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts +}; + +pp$2.parseBindingListItem = function(param) { + return param +}; + +// Parses assignment pattern around given atom if possible. + +pp$2.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern") +}; + +// Verify that a node is an lval — something that can be assigned +// to. +// bindingType can be either: +// 'var' indicating that the lval creates a 'var' binding +// 'let' indicating that the lval creates a lexical ('let' or 'const') binding +// 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references + +pp$2.checkLVal = function(expr, bindingType, checkClashes) { + var this$1 = this; + + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) + { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } + if (checkClashes) { + if (has(checkClashes, expr.name)) + { this.raiseRecoverable(expr.start, "Argument name clash"); } + checkClashes[expr.name] = true; + } + if (bindingType && bindingType !== "none") { + if ( + bindingType === "var" && !this.canDeclareVarName(expr.name) || + bindingType !== "var" && !this.canDeclareLexicalName(expr.name) + ) { + this.raiseRecoverable(expr.start, ("Identifier '" + (expr.name) + "' has already been declared")); + } + if (bindingType === "var") { + this.declareVarName(expr.name); + } else { + this.declareLexicalName(expr.name); + } + } + break + + case "MemberExpression": + if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } + break + + case "ObjectPattern": + for (var i = 0, list = expr.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this$1.checkLVal(prop, bindingType, checkClashes); + } + break + + case "Property": + // AssignmentProperty has type == "Property" + this.checkLVal(expr.value, bindingType, checkClashes); + break + + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + + if (elem) { this$1.checkLVal(elem, bindingType, checkClashes); } + } + break + + case "AssignmentPattern": + this.checkLVal(expr.left, bindingType, checkClashes); + break + + case "RestElement": + this.checkLVal(expr.argument, bindingType, checkClashes); + break + + case "ParenthesizedExpression": + this.checkLVal(expr.expression, bindingType, checkClashes); + break + + default: + this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue"); + } +}; + +// A recursive descent parser operates by defining functions for all +// syntactic elements, and recursively calling those, each function +// advancing the input stream and returning an AST node. Precedence +// of constructs (for example, the fact that `!x[1]` means `!(x[1])` +// instead of `(!x)[1]` is handled by the fact that the parser +// function that parses unary prefix operators is called first, and +// in turn calls the function that parses `[]` subscripts — that +// way, it'll receive the node for `x[1]` already parsed, and wraps +// *that* in the unary operator node. +// +// Acorn uses an [operator precedence parser][opp] to handle binary +// operator precedence, because it is much more compact than using +// the technique outlined above, which uses different, nesting +// functions to specify precedence, for all of the ten binary +// precedence levels that JavaScript defines. +// +// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser + +var pp$3 = Parser.prototype; + +// Check if property name clashes with already added. +// Object/class getters and setters are not allowed to clash — +// either with each other or with an init property — and in +// strict mode, init properties are also not allowed to be repeated. + +pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") + { return } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) + { return } + var key = prop.key; + var name; + switch (key.type) { + case "Identifier": name = key.name; break + case "Literal": name = String(key.value); break + default: return + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; } + // Backwards-compat kludge. Can be removed in version 6.0 + else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + } + propHash.proto = true; + } + return + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) + { this.raiseRecoverable(key.start, "Redefinition of property"); } + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; +}; + +// ### Expression parsing + +// These nest, from the most general expression type at the top to +// 'atomic', nondivisible expression types at the bottom. Most of +// the functions will simply let the function(s) below them parse, +// and, *if* the syntactic construct they handle is present, wrap +// the AST node that the inner parser gave them in another node. + +// Parse a full expression. The optional arguments are used to +// forbid the `in` operator (in for loops initalization expressions) +// and provide reference for storing '=' operator inside shorthand +// property assignment in contexts where both object expression +// and object pattern might appear (so it's possible to raise +// delayed syntax error at correct position). + +pp$3.parseExpression = function(noIn, refDestructuringErrors) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); + if (this.type === types.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types.comma)) { node.expressions.push(this$1.parseMaybeAssign(noIn, refDestructuringErrors)); } + return this.finishNode(node, "SequenceExpression") + } + return expr +}; + +// Parse an assignment expression. This includes applications of +// operators like `+=`. + +pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { + if (this.inGenerator && this.isContextual("yield")) { return this.parseYield() } + + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors; + ownDestructuringErrors = true; + } + + var startPos = this.start, startLoc = this.startLoc; + if (this.type == types.parenL || this.type == types.name) + { this.potentialArrowAt = this.start; } + var left = this.parseMaybeConditional(noIn, refDestructuringErrors); + if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; + if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); } + refDestructuringErrors.shorthandAssign = -1; // reset because shorthand default was used correctly + this.checkLVal(left); + this.next(); + node.right = this.parseMaybeAssign(noIn); + return this.finishNode(node, "AssignmentExpression") + } else { + if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } + } + if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } + if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } + return left +}; + +// Parse a ternary conditional (`?:`) operator. + +pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(noIn, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + if (this.eat(types.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types.colon); + node.alternate = this.parseMaybeAssign(noIn); + return this.finishNode(node, "ConditionalExpression") + } + return expr +}; + +// Start the precedence parser. + +pp$3.parseExprOps = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + return expr.start == startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) +}; + +// Parse binary operators with the operator precedence parsing +// algorithm. `left` is the left-hand side of the operator. +// `minPrec` provides context that allows the function to stop and +// defer further parser to one of its callers when it encounters an +// operator that has a lower precedence than the set it is parsing. + +pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { + var prec = this.type.binop; + if (prec != null && (!noIn || this.type !== types._in)) { + if (prec > minPrec) { + var logical = this.type === types.logicalOR || this.type === types.logicalAND; + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical); + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) + } + } + return left +}; + +pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") +}; + +// Parse unary operators, both prefix and postfix. + +pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.inAsync && this.isContextual("await")) { + expr = this.parseAwait(); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { this.checkLVal(node.argument); } + else if (this.strict && node.operator === "delete" && + node.argument.type === "Identifier") + { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } + else { sawUnary = true; } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else { + expr = this.parseExprSubscripts(refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this$1.startNodeAt(startPos, startLoc); + node$1.operator = this$1.value; + node$1.prefix = false; + node$1.argument = expr; + this$1.checkLVal(expr); + this$1.next(); + expr = this$1.finishNode(node$1, "UpdateExpression"); + } + } + + if (!sawUnary && this.eat(types.starstar)) + { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } + else + { return expr } +}; + +// Parse call, dot, and `[]`-subscript expressions. + +pp$3.parseExprSubscripts = function(refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors); + var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"; + if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr } + var result = this.parseSubscripts(expr, startPos, startLoc); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } + if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } + } + return result +}; + +pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { + var this$1 = this; + + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && + this.lastTokEnd == base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async"; + for (var computed = (void 0);;) { + if ((computed = this$1.eat(types.bracketL)) || this$1.eat(types.dot)) { + var node = this$1.startNodeAt(startPos, startLoc); + node.object = base; + node.property = computed ? this$1.parseExpression() : this$1.parseIdent(true); + node.computed = !!computed; + if (computed) { this$1.expect(types.bracketR); } + base = this$1.finishNode(node, "MemberExpression"); + } else if (!noCalls && this$1.eat(types.parenL)) { + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this$1.yieldPos, oldAwaitPos = this$1.awaitPos; + this$1.yieldPos = 0; + this$1.awaitPos = 0; + var exprList = this$1.parseExprList(types.parenR, this$1.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !this$1.canInsertSemicolon() && this$1.eat(types.arrow)) { + this$1.checkPatternErrors(refDestructuringErrors, false); + this$1.checkYieldAwaitInDefaultParams(); + this$1.yieldPos = oldYieldPos; + this$1.awaitPos = oldAwaitPos; + return this$1.parseArrowExpression(this$1.startNodeAt(startPos, startLoc), exprList, true) + } + this$1.checkExpressionErrors(refDestructuringErrors, true); + this$1.yieldPos = oldYieldPos || this$1.yieldPos; + this$1.awaitPos = oldAwaitPos || this$1.awaitPos; + var node$1 = this$1.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + base = this$1.finishNode(node$1, "CallExpression"); + } else if (this$1.type === types.backQuote) { + var node$2 = this$1.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this$1.parseTemplate({isTagged: true}); + base = this$1.finishNode(node$2, "TaggedTemplateExpression"); + } else { + return base + } + } +}; + +// Parse an atomic expression — either a single token that is an +// expression, an expression started by a keyword like `function` or +// `new`, or an expression wrapped in punctuation like `()`, `[]`, +// or `{}`. + +pp$3.parseExprAtom = function(refDestructuringErrors) { + var node, canBeArrow = this.potentialArrowAt == this.start; + switch (this.type) { + case types._super: + if (!this.inFunction) + { this.raise(this.start, "'super' outside of function or class"); } + node = this.startNode(); + this.next(); + // The `super` keyword can appear at below: + // SuperProperty: + // super [ Expression ] + // super . IdentifierName + // SuperCall: + // super Arguments + if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + { this.unexpected(); } + return this.finishNode(node, "Super") + + case types._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression") + + case types.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(this.type !== types.name); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) + { return this.parseFunction(this.startNodeAt(startPos, startLoc), false, false, true) } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types.arrow)) + { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { + id = this.parseIdent(); + if (this.canInsertSemicolon() || !this.eat(types.arrow)) + { this.unexpected(); } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) + } + } + return id + + case types.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = {pattern: value.pattern, flags: value.flags}; + return node + + case types.num: case types.string: + return this.parseLiteral(this.value) + + case types._null: case types._true: case types._false: + node = this.startNode(); + node.value = this.type === types._null ? null : this.type === types._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal") + + case types.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) + { refDestructuringErrors.parenthesizedAssign = start; } + if (refDestructuringErrors.parenthesizedBind < 0) + { refDestructuringErrors.parenthesizedBind = start; } + } + return expr + + case types.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression") + + case types.braceL: + return this.parseObj(false, refDestructuringErrors) + + case types._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, false) + + case types._class: + return this.parseClass(this.startNode(), false) + + case types._new: + return this.parseNew() + + case types.backQuote: + return this.parseTemplate() + + default: + this.unexpected(); + } +}; + +pp$3.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + this.next(); + return this.finishNode(node, "Literal") +}; + +pp$3.parseParenExpression = function() { + this.expect(types.parenL); + var val = this.parseExpression(); + this.expect(types.parenR); + return val +}; + +pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + while (this.type !== types.parenR) { + first ? first = false : this$1.expect(types.comma); + if (allowTrailingComma && this$1.afterTrailingComma(types.parenR, true)) { + lastIsComma = true; + break + } else if (this$1.type === types.ellipsis) { + spreadStart = this$1.start; + exprList.push(this$1.parseParenItem(this$1.parseRestBinding())); + if (this$1.type === types.comma) { this$1.raise(this$1.start, "Comma is not permitted after the rest element"); } + break + } else { + exprList.push(this$1.parseMaybeAssign(false, refDestructuringErrors, this$1.parseParenItem)); + } + } + var innerEndPos = this.start, innerEndLoc = this.startLoc; + this.expect(types.parenR); + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList) + } + + if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } + if (spreadStart) { this.unexpected(spreadStart); } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression") + } else { + return val + } +}; + +pp$3.parseParenItem = function(item) { + return item +}; + +pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) +}; + +// New's precedence is slightly tricky. It must allow its argument to +// be a `[]` or dot subscript expression, but not a call — at least, +// not without wrapping it in parentheses. Thus, it uses the noCalls +// argument to parseSubscripts to prevent it from consuming the +// argument list. + +var empty$1 = []; + +pp$3.parseNew = function() { + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target" || containsEsc) + { this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); } + if (!this.inFunction) + { this.raiseRecoverable(node.start, "new.target can only be used in functions"); } + return this.finishNode(node, "MetaProperty") + } + var startPos = this.start, startLoc = this.startLoc; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } + else { node.arguments = empty$1; } + return this.finishNode(node, "NewExpression") +}; + +// Parse template expression. + +pp$3.parseTemplateElement = function(ref) { + var isTagged = ref.isTagged; + + var elem = this.startNode(); + if (this.type === types.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types.backQuote; + return this.finishNode(elem, "TemplateElement") +}; + +pp$3.parseTemplate = function(ref) { + var this$1 = this; + if ( ref === void 0 ) ref = {}; + var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; + + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({isTagged: isTagged}); + node.quasis = [curElt]; + while (!curElt.tail) { + this$1.expect(types.dollarBraceL); + node.expressions.push(this$1.parseExpression()); + this$1.expect(types.braceR); + node.quasis.push(curElt = this$1.parseTemplateElement({isTagged: isTagged})); + } + this.next(); + return this.finishNode(node, "TemplateLiteral") +}; + +pp$3.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && + (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) +}; + +// Parse an object literal or binding pattern. + +pp$3.parseObj = function(isPattern, refDestructuringErrors) { + var this$1 = this; + + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types.braceR)) { + if (!first) { + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var prop = this$1.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { this$1.checkPropClash(prop, propHash, refDestructuringErrors); } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") +}; + +pp$3.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement") + } + // To disallow parenthesized identifier via `this.toAssignable()`. + if (this.type === types.parenL && refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0) { + refDestructuringErrors.parenthesizedAssign = this.start; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = this.start; + } + } + // Parse argument. + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + // To disallow trailing comma via `this.toAssignable()`. + if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + // Finish + return this.finishNode(prop, "SpreadElement") + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) + { isGenerator = this.eat(types.star); } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property") +}; + +pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types.colon) + { this.unexpected(); } + + if (this.eat(types.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + if (isPattern) { this.unexpected(); } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && + this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set") && + (this.type != types.comma && this.type != types.braceR)) { + if (isGenerator || isAsync) { this.unexpected(); } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") + { this.raiseRecoverable(start, "getter should have no params"); } + else + { this.raiseRecoverable(start, "setter should have exactly one param"); } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") + { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + this.checkUnreserved(prop.key); + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else if (this.type === types.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) + { refDestructuringErrors.shorthandAssign = this.start; } + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else { + prop.value = prop.key; + } + prop.shorthand = true; + } else { this.unexpected(); } +}; + +pp$3.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types.bracketR); + return prop.key + } else { + prop.computed = false; + } + } + return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(true) +}; + +// Initialize empty function node. + +pp$3.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { + node.generator = false; + node.expression = false; + } + if (this.options.ecmaVersion >= 8) + { node.async = false; } +}; + +// Parse object or class method. + +pp$3.parseMethod = function(isGenerator, isAsync) { + var node = this.startNode(), oldInGen = this.inGenerator, oldInAsync = this.inAsync, + oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldInFunc = this.inFunction; + + this.initFunction(node); + if (this.options.ecmaVersion >= 6) + { node.generator = isGenerator; } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + this.inGenerator = node.generator; + this.inAsync = node.async; + this.yieldPos = 0; + this.awaitPos = 0; + this.inFunction = true; + this.enterFunctionScope(); + + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false); + + this.inGenerator = oldInGen; + this.inAsync = oldInAsync; + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.inFunction = oldInFunc; + return this.finishNode(node, "FunctionExpression") +}; + +// Parse arrow function expression with given parameters. + +pp$3.parseArrowExpression = function(node, params, isAsync) { + var oldInGen = this.inGenerator, oldInAsync = this.inAsync, + oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldInFunc = this.inFunction; + + this.enterFunctionScope(); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + this.inGenerator = false; + this.inAsync = node.async; + this.yieldPos = 0; + this.awaitPos = 0; + this.inFunction = true; + + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true); + + this.inGenerator = oldInGen; + this.inAsync = oldInAsync; + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.inFunction = oldInFunc; + return this.finishNode(node, "ArrowFunctionExpression") +}; + +// Parse function body and check parameters. + +pp$3.parseFunctionBody = function(node, isArrowFunction) { + var isExpression = isArrowFunction && this.type !== types.braceL; + var oldStrict = this.strict, useStrict = false; + + if (isExpression) { + node.body = this.parseMaybeAssign(); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (useStrict && nonSimple) + { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } + } + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { this.strict = true; } + + // Add the params to varDeclaredNames to ensure that an error is thrown + // if a let/const declaration in the function clashes with one of the params. + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && this.isSimpleParamList(node.params)); + node.body = this.parseBlock(false); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitFunctionScope(); + + if (this.strict && node.id) { + // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' + this.checkLVal(node.id, "none"); + } + this.strict = oldStrict; +}; + +pp$3.isSimpleParamList = function(params) { + for (var i = 0, list = params; i < list.length; i += 1) + { + var param = list[i]; + + if (param.type !== "Identifier") { return false + } } + return true +}; + +// Checks function params for various disallowed patterns such as using "eval" +// or "arguments" and duplicate parameters. + +pp$3.checkParams = function(node, allowDuplicates) { + var this$1 = this; + + var nameHash = {}; + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; + + this$1.checkLVal(param, "var", allowDuplicates ? null : nameHash); + } +}; + +// Parses a comma-separated list of expressions, and returns them as +// an array. `close` is the token type that ends the list, and +// `allowEmpty` can be turned on to allow subsequent commas with +// nothing in between them to be parsed as `null` (which is needed +// for array literals). + +pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var this$1 = this; + + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this$1.expect(types.comma); + if (allowTrailingComma && this$1.afterTrailingComma(close)) { break } + } else { first = false; } + + var elt = (void 0); + if (allowEmpty && this$1.type === types.comma) + { elt = null; } + else if (this$1.type === types.ellipsis) { + elt = this$1.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this$1.type === types.comma && refDestructuringErrors.trailingComma < 0) + { refDestructuringErrors.trailingComma = this$1.start; } + } else { + elt = this$1.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts +}; + +pp$3.checkUnreserved = function(ref) { + var start = ref.start; + var end = ref.end; + var name = ref.name; + + if (this.inGenerator && name === "yield") + { this.raiseRecoverable(start, "Can not use 'yield' as identifier inside a generator"); } + if (this.inAsync && name === "await") + { this.raiseRecoverable(start, "Can not use 'await' as identifier inside an async function"); } + if (this.isKeyword(name)) + { this.raise(start, ("Unexpected keyword '" + name + "'")); } + if (this.options.ecmaVersion < 6 && + this.input.slice(start, end).indexOf("\\") != -1) { return } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") + { this.raiseRecoverable(start, "Can not use keyword 'await' outside an async function"); } + this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); + } +}; + +// Parse the next token as an identifier. If `liberal` is true (used +// when parsing properties), it will also convert keywords into +// identifiers. + +pp$3.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (liberal && this.options.allowReserved == "never") { liberal = false; } + if (this.type === types.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + + // To fix https://github.com/acornjs/acorn/issues/575 + // `class` and `function` keywords push new context into this.context. + // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. + // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword + if ((node.name === "class" || node.name === "function") && + (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "Identifier"); + if (!liberal) { this.checkUnreserved(node); } + return node +}; + +// Parses yield expression inside generator. + +pp$3.parseYield = function() { + if (!this.yieldPos) { this.yieldPos = this.start; } + + var node = this.startNode(); + this.next(); + if (this.type == types.semi || this.canInsertSemicolon() || (this.type != types.star && !this.type.startsExpr)) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types.star); + node.argument = this.parseMaybeAssign(); + } + return this.finishNode(node, "YieldExpression") +}; + +pp$3.parseAwait = function() { + if (!this.awaitPos) { this.awaitPos = this.start; } + + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true); + return this.finishNode(node, "AwaitExpression") +}; + +var pp$4 = Parser.prototype; + +// This function is used to raise exceptions on parse errors. It +// takes an offset integer (into the current `input`) to indicate +// the location of the error, attaches the position to the end +// of the error message, and then raises a `SyntaxError` with that +// message. + +pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; err.loc = loc; err.raisedAt = this.pos; + throw err +}; + +pp$4.raiseRecoverable = pp$4.raise; + +pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart) + } +}; + +var pp$5 = Parser.prototype; + +// Object.assign polyfill +var assign = Object.assign || function(target) { + var sources = [], len = arguments.length - 1; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; + + for (var i = 0, list = sources; i < list.length; i += 1) { + var source = list[i]; + + for (var key in source) { + if (has(source, key)) { + target[key] = source[key]; + } + } + } + return target +}; + +// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. + +pp$5.enterFunctionScope = function() { + // var: a hash of var-declared names in the current lexical scope + // lexical: a hash of lexically-declared names in the current lexical scope + // childVar: a hash of var-declared names in all child lexical scopes of the current lexical scope (within the current function scope) + // parentLexical: a hash of lexically-declared names in all parent lexical scopes of the current lexical scope (within the current function scope) + this.scopeStack.push({var: {}, lexical: {}, childVar: {}, parentLexical: {}}); +}; + +pp$5.exitFunctionScope = function() { + this.scopeStack.pop(); +}; + +pp$5.enterLexicalScope = function() { + var parentScope = this.scopeStack[this.scopeStack.length - 1]; + var childScope = {var: {}, lexical: {}, childVar: {}, parentLexical: {}}; + + this.scopeStack.push(childScope); + assign(childScope.parentLexical, parentScope.lexical, parentScope.parentLexical); +}; + +pp$5.exitLexicalScope = function() { + var childScope = this.scopeStack.pop(); + var parentScope = this.scopeStack[this.scopeStack.length - 1]; + + assign(parentScope.childVar, childScope.var, childScope.childVar); +}; + +/** + * A name can be declared with `var` if there are no variables with the same name declared with `let`/`const` + * in the current lexical scope or any of the parent lexical scopes in this function. + */ +pp$5.canDeclareVarName = function(name) { + var currentScope = this.scopeStack[this.scopeStack.length - 1]; + + return !has(currentScope.lexical, name) && !has(currentScope.parentLexical, name) +}; + +/** + * A name can be declared with `let`/`const` if there are no variables with the same name declared with `let`/`const` + * in the current scope, and there are no variables with the same name declared with `var` in the current scope or in + * any child lexical scopes in this function. + */ +pp$5.canDeclareLexicalName = function(name) { + var currentScope = this.scopeStack[this.scopeStack.length - 1]; + + return !has(currentScope.lexical, name) && !has(currentScope.var, name) && !has(currentScope.childVar, name) +}; + +pp$5.declareVarName = function(name) { + this.scopeStack[this.scopeStack.length - 1].var[name] = true; +}; + +pp$5.declareLexicalName = function(name) { + this.scopeStack[this.scopeStack.length - 1].lexical[name] = true; +}; + +var Node = function Node(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) + { this.loc = new SourceLocation(parser, loc); } + if (parser.options.directSourceFile) + { this.sourceFile = parser.options.directSourceFile; } + if (parser.options.ranges) + { this.range = [pos, 0]; } +}; + +// Start an AST node, attaching a start offset. + +var pp$6 = Parser.prototype; + +pp$6.startNode = function() { + return new Node(this, this.start, this.startLoc) +}; + +pp$6.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc) +}; + +// Finish an AST node, adding `type` and `end` properties. + +function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) + { node.loc.end = loc; } + if (this.options.ranges) + { node.range[1] = pos; } + return node +} + +pp$6.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) +}; + +// Finish node at given position + +pp$6.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc) +}; + +// The algorithm used to determine whether a regexp can appear at a +// given point in the program is loosely based on sweet.js' approach. +// See https://github.com/mozilla/sweet.js/wiki/design + +var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; +}; + +var types$1 = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) +}; + +var pp$7 = Parser.prototype; + +pp$7.initialContext = function() { + return [types$1.b_stat] +}; + +pp$7.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types$1.f_expr || parent === types$1.f_stat) + { return true } + if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) + { return !parent.isExpr } + + // The check for `tt.name && exprAllowed` detects whether we are + // after a `yield` or `of` construct. See the `updateContext` for + // `tt.name`. + if (prevType === types._return || prevType == types.name && this.exprAllowed) + { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } + if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType == types.arrow) + { return true } + if (prevType == types.braceL) + { return parent === types$1.b_stat } + if (prevType == types._var || prevType == types.name) + { return false } + return !this.exprAllowed +}; + +pp$7.inGeneratorContext = function() { + var this$1 = this; + + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this$1.context[i]; + if (context.token === "function") + { return context.generator } + } + return false +}; + +pp$7.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType == types.dot) + { this.exprAllowed = false; } + else if (update = type.updateContext) + { update.call(this, prevType); } + else + { this.exprAllowed = type.beforeExpr; } +}; + +// Token-specific context update code + +types.parenR.updateContext = types.braceR.updateContext = function() { + if (this.context.length == 1) { + this.exprAllowed = true; + return + } + var out = this.context.pop(); + if (out === types$1.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; +}; + +types.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); + this.exprAllowed = true; +}; + +types.dollarBraceL.updateContext = function() { + this.context.push(types$1.b_tmpl); + this.exprAllowed = true; +}; + +types.parenL.updateContext = function(prevType) { + var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; + this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); + this.exprAllowed = true; +}; + +types.incDec.updateContext = function() { + // tokExprAllowed stays unchanged +}; + +types._function.updateContext = types._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && + !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) + { this.context.push(types$1.f_expr); } + else + { this.context.push(types$1.f_stat); } + this.exprAllowed = false; +}; + +types.backQuote.updateContext = function() { + if (this.curContext() === types$1.q_tmpl) + { this.context.pop(); } + else + { this.context.push(types$1.q_tmpl); } + this.exprAllowed = false; +}; + +types.star.updateContext = function(prevType) { + if (prevType == types._function) { + var index = this.context.length - 1; + if (this.context[index] === types$1.f_expr) + { this.context[index] = types$1.f_expr_gen; } + else + { this.context[index] = types$1.f_gen; } + } + this.exprAllowed = true; +}; + +types.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6) { + if (this.value == "of" && !this.exprAllowed || + this.value == "yield" && this.inGeneratorContext()) + { allowed = true; } + } + this.exprAllowed = allowed; +}; + +var data = { + "$LONE": [ + "ASCII", + "ASCII_Hex_Digit", + "AHex", + "Alphabetic", + "Alpha", + "Any", + "Assigned", + "Bidi_Control", + "Bidi_C", + "Bidi_Mirrored", + "Bidi_M", + "Case_Ignorable", + "CI", + "Cased", + "Changes_When_Casefolded", + "CWCF", + "Changes_When_Casemapped", + "CWCM", + "Changes_When_Lowercased", + "CWL", + "Changes_When_NFKC_Casefolded", + "CWKCF", + "Changes_When_Titlecased", + "CWT", + "Changes_When_Uppercased", + "CWU", + "Dash", + "Default_Ignorable_Code_Point", + "DI", + "Deprecated", + "Dep", + "Diacritic", + "Dia", + "Emoji", + "Emoji_Component", + "Emoji_Modifier", + "Emoji_Modifier_Base", + "Emoji_Presentation", + "Extender", + "Ext", + "Grapheme_Base", + "Gr_Base", + "Grapheme_Extend", + "Gr_Ext", + "Hex_Digit", + "Hex", + "IDS_Binary_Operator", + "IDSB", + "IDS_Trinary_Operator", + "IDST", + "ID_Continue", + "IDC", + "ID_Start", + "IDS", + "Ideographic", + "Ideo", + "Join_Control", + "Join_C", + "Logical_Order_Exception", + "LOE", + "Lowercase", + "Lower", + "Math", + "Noncharacter_Code_Point", + "NChar", + "Pattern_Syntax", + "Pat_Syn", + "Pattern_White_Space", + "Pat_WS", + "Quotation_Mark", + "QMark", + "Radical", + "Regional_Indicator", + "RI", + "Sentence_Terminal", + "STerm", + "Soft_Dotted", + "SD", + "Terminal_Punctuation", + "Term", + "Unified_Ideograph", + "UIdeo", + "Uppercase", + "Upper", + "Variation_Selector", + "VS", + "White_Space", + "space", + "XID_Continue", + "XIDC", + "XID_Start", + "XIDS" + ], + "General_Category": [ + "Cased_Letter", + "LC", + "Close_Punctuation", + "Pe", + "Connector_Punctuation", + "Pc", + "Control", + "Cc", + "cntrl", + "Currency_Symbol", + "Sc", + "Dash_Punctuation", + "Pd", + "Decimal_Number", + "Nd", + "digit", + "Enclosing_Mark", + "Me", + "Final_Punctuation", + "Pf", + "Format", + "Cf", + "Initial_Punctuation", + "Pi", + "Letter", + "L", + "Letter_Number", + "Nl", + "Line_Separator", + "Zl", + "Lowercase_Letter", + "Ll", + "Mark", + "M", + "Combining_Mark", + "Math_Symbol", + "Sm", + "Modifier_Letter", + "Lm", + "Modifier_Symbol", + "Sk", + "Nonspacing_Mark", + "Mn", + "Number", + "N", + "Open_Punctuation", + "Ps", + "Other", + "C", + "Other_Letter", + "Lo", + "Other_Number", + "No", + "Other_Punctuation", + "Po", + "Other_Symbol", + "So", + "Paragraph_Separator", + "Zp", + "Private_Use", + "Co", + "Punctuation", + "P", + "punct", + "Separator", + "Z", + "Space_Separator", + "Zs", + "Spacing_Mark", + "Mc", + "Surrogate", + "Cs", + "Symbol", + "S", + "Titlecase_Letter", + "Lt", + "Unassigned", + "Cn", + "Uppercase_Letter", + "Lu" + ], + "Script": [ + "Adlam", + "Adlm", + "Ahom", + "Anatolian_Hieroglyphs", + "Hluw", + "Arabic", + "Arab", + "Armenian", + "Armn", + "Avestan", + "Avst", + "Balinese", + "Bali", + "Bamum", + "Bamu", + "Bassa_Vah", + "Bass", + "Batak", + "Batk", + "Bengali", + "Beng", + "Bhaiksuki", + "Bhks", + "Bopomofo", + "Bopo", + "Brahmi", + "Brah", + "Braille", + "Brai", + "Buginese", + "Bugi", + "Buhid", + "Buhd", + "Canadian_Aboriginal", + "Cans", + "Carian", + "Cari", + "Caucasian_Albanian", + "Aghb", + "Chakma", + "Cakm", + "Cham", + "Cherokee", + "Cher", + "Common", + "Zyyy", + "Coptic", + "Copt", + "Qaac", + "Cuneiform", + "Xsux", + "Cypriot", + "Cprt", + "Cyrillic", + "Cyrl", + "Deseret", + "Dsrt", + "Devanagari", + "Deva", + "Duployan", + "Dupl", + "Egyptian_Hieroglyphs", + "Egyp", + "Elbasan", + "Elba", + "Ethiopic", + "Ethi", + "Georgian", + "Geor", + "Glagolitic", + "Glag", + "Gothic", + "Goth", + "Grantha", + "Gran", + "Greek", + "Grek", + "Gujarati", + "Gujr", + "Gurmukhi", + "Guru", + "Han", + "Hani", + "Hangul", + "Hang", + "Hanunoo", + "Hano", + "Hatran", + "Hatr", + "Hebrew", + "Hebr", + "Hiragana", + "Hira", + "Imperial_Aramaic", + "Armi", + "Inherited", + "Zinh", + "Qaai", + "Inscriptional_Pahlavi", + "Phli", + "Inscriptional_Parthian", + "Prti", + "Javanese", + "Java", + "Kaithi", + "Kthi", + "Kannada", + "Knda", + "Katakana", + "Kana", + "Kayah_Li", + "Kali", + "Kharoshthi", + "Khar", + "Khmer", + "Khmr", + "Khojki", + "Khoj", + "Khudawadi", + "Sind", + "Lao", + "Laoo", + "Latin", + "Latn", + "Lepcha", + "Lepc", + "Limbu", + "Limb", + "Linear_A", + "Lina", + "Linear_B", + "Linb", + "Lisu", + "Lycian", + "Lyci", + "Lydian", + "Lydi", + "Mahajani", + "Mahj", + "Malayalam", + "Mlym", + "Mandaic", + "Mand", + "Manichaean", + "Mani", + "Marchen", + "Marc", + "Masaram_Gondi", + "Gonm", + "Meetei_Mayek", + "Mtei", + "Mende_Kikakui", + "Mend", + "Meroitic_Cursive", + "Merc", + "Meroitic_Hieroglyphs", + "Mero", + "Miao", + "Plrd", + "Modi", + "Mongolian", + "Mong", + "Mro", + "Mroo", + "Multani", + "Mult", + "Myanmar", + "Mymr", + "Nabataean", + "Nbat", + "New_Tai_Lue", + "Talu", + "Newa", + "Nko", + "Nkoo", + "Nushu", + "Nshu", + "Ogham", + "Ogam", + "Ol_Chiki", + "Olck", + "Old_Hungarian", + "Hung", + "Old_Italic", + "Ital", + "Old_North_Arabian", + "Narb", + "Old_Permic", + "Perm", + "Old_Persian", + "Xpeo", + "Old_South_Arabian", + "Sarb", + "Old_Turkic", + "Orkh", + "Oriya", + "Orya", + "Osage", + "Osge", + "Osmanya", + "Osma", + "Pahawh_Hmong", + "Hmng", + "Palmyrene", + "Palm", + "Pau_Cin_Hau", + "Pauc", + "Phags_Pa", + "Phag", + "Phoenician", + "Phnx", + "Psalter_Pahlavi", + "Phlp", + "Rejang", + "Rjng", + "Runic", + "Runr", + "Samaritan", + "Samr", + "Saurashtra", + "Saur", + "Sharada", + "Shrd", + "Shavian", + "Shaw", + "Siddham", + "Sidd", + "SignWriting", + "Sgnw", + "Sinhala", + "Sinh", + "Sora_Sompeng", + "Sora", + "Soyombo", + "Soyo", + "Sundanese", + "Sund", + "Syloti_Nagri", + "Sylo", + "Syriac", + "Syrc", + "Tagalog", + "Tglg", + "Tagbanwa", + "Tagb", + "Tai_Le", + "Tale", + "Tai_Tham", + "Lana", + "Tai_Viet", + "Tavt", + "Takri", + "Takr", + "Tamil", + "Taml", + "Tangut", + "Tang", + "Telugu", + "Telu", + "Thaana", + "Thaa", + "Thai", + "Tibetan", + "Tibt", + "Tifinagh", + "Tfng", + "Tirhuta", + "Tirh", + "Ugaritic", + "Ugar", + "Vai", + "Vaii", + "Warang_Citi", + "Wara", + "Yi", + "Yiii", + "Zanabazar_Square", + "Zanb" + ] +}; +Array.prototype.push.apply(data.$LONE, data.General_Category); +data.gc = data.General_Category; +data.sc = data.Script_Extensions = data.scx = data.Script; + +var pp$9 = Parser.prototype; + +var RegExpValidationState = function RegExpValidationState(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; +}; + +RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; +}; + +RegExpValidationState.prototype.raise = function raise (message) { + this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); +}; + +// If u flag is given, this returns the code point at the index (it combines a surrogate pair). +// Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). +RegExpValidationState.prototype.at = function at (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return -1 + } + var c = s.charCodeAt(i); + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return c + } + return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00 +}; + +RegExpValidationState.prototype.nextIndex = function nextIndex (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return l + } + var c = s.charCodeAt(i); + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return i + 1 + } + return i + 2 +}; + +RegExpValidationState.prototype.current = function current () { + return this.at(this.pos) +}; + +RegExpValidationState.prototype.lookahead = function lookahead () { + return this.at(this.nextIndex(this.pos)) +}; + +RegExpValidationState.prototype.advance = function advance () { + this.pos = this.nextIndex(this.pos); +}; + +RegExpValidationState.prototype.eat = function eat (ch) { + if (this.current() === ch) { + this.advance(); + return true + } + return false +}; + +function codePointToString$1(ch) { + if (ch <= 0xFFFF) { return String.fromCharCode(ch) } + ch -= 0x10000; + return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) +} + +/** + * Validate the flags part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ +pp$9.validateRegExpFlags = function(state) { + var this$1 = this; + + var validFlags = state.validFlags; + var flags = state.flags; + + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) == -1) { + this$1.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this$1.raise(state.start, "Duplicate regular expression flag"); + } + } +}; + +/** + * Validate the pattern part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ +pp$9.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + + // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of + // parsing contains a |GroupName|, reparse with the goal symbol + // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* + // exception if _P_ did not conform to the grammar, if any elements of _P_ + // were not matched by the parse, or if any Early Error conditions exist. + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern +pp$9.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + + this.regexp_disjunction(state); + + if (state.pos !== state.source.length) { + // Make the same messages as V8. + if (state.eat(0x29 /* ) */)) { + state.raise("Unmatched ')'"); + } + if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { + var name = list[i]; + + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction +pp$9.regexp_disjunction = function(state) { + var this$1 = this; + + this.regexp_alternative(state); + while (state.eat(0x7C /* | */)) { + this$1.regexp_alternative(state); + } + + // Make the same message as V8. + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(0x7B /* { */)) { + state.raise("Lone quantifier brackets"); + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative +pp$9.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) + { } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term +pp$9.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + // Handle `QuantifiableAssertion Quantifier` alternative. + // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion + // is a QuantifiableAssertion. + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + // Make the same message as V8. + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true + } + + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true + } + + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion +pp$9.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; + + // ^, $ + if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { + return true + } + + // \b \B + if (state.eat(0x5C /* \ */)) { + if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { + return true + } + state.pos = start; + } + + // Lookahead / Lookbehind + if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(0x3C /* < */); + } + if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { + this.regexp_disjunction(state); + if (!state.eat(0x29 /* ) */)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true + } + } + + state.pos = start; + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier +pp$9.regexp_eatQuantifier = function(state, noError) { + if ( noError === void 0 ) noError = false; + + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(0x3F /* ? */); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix +pp$9.regexp_eatQuantifierPrefix = function(state, noError) { + return ( + state.eat(0x2A /* * */) || + state.eat(0x2B /* + */) || + state.eat(0x3F /* ? */) || + this.regexp_eatBracedQuantifier(state, noError) + ) +}; +pp$9.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat(0x7B /* { */)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(0x7D /* } */)) { + // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start; + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom +pp$9.regexp_eatAtom = function(state) { + return ( + this.regexp_eatPatternCharacters(state) || + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) + ) +}; +pp$9.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatAtomEscape(state)) { + return true + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat(0x28 /* ( */)) { + if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + return true + } + state.raise("Unterminated group"); + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatCapturingGroup = function(state) { + if (state.eat(0x28 /* ( */)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 0x3F /* ? */) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + state.numCapturingParens += 1; + return true + } + state.raise("Unterminated group"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom +pp$9.regexp_eatExtendedAtom = function(state) { + return ( + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) || + this.regexp_eatInvalidBracedQuantifier(state) || + this.regexp_eatExtendedPatternCharacter(state) + ) +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier +pp$9.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter +pp$9.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false +}; +function isSyntaxCharacter(ch) { + return ( + ch === 0x24 /* $ */ || + ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || + ch === 0x2E /* . */ || + ch === 0x3F /* ? */ || + ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter +// But eat eager. +pp$9.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter +pp$9.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if ( + ch !== -1 && + ch !== 0x24 /* $ */ && + !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && + ch !== 0x2E /* . */ && + ch !== 0x3F /* ? */ && + ch !== 0x5B /* [ */ && + ch !== 0x5E /* ^ */ && + ch !== 0x7C /* | */ + ) { + state.advance(); + return true + } + return false +}; + +// GroupSpecifier[U] :: +// [empty] +// `?` GroupName[?U] +pp$9.regexp_groupSpecifier = function(state) { + if (state.eat(0x3F /* ? */)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return + } + state.raise("Invalid group"); + } +}; + +// GroupName[U] :: +// `<` RegExpIdentifierName[?U] `>` +// Note: this updates `state.lastStringValue` property with the eaten name. +pp$9.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(0x3C /* < */)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { + return true + } + state.raise("Invalid capture group name"); + } + return false +}; + +// RegExpIdentifierName[U] :: +// RegExpIdentifierStart[?U] +// RegExpIdentifierName[?U] RegExpIdentifierPart[?U] +// Note: this updates `state.lastStringValue` property with the eaten name. +pp$9.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString$1(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString$1(state.lastIntValue); + } + return true + } + return false +}; + +// RegExpIdentifierStart[U] :: +// UnicodeIDStart +// `$` +// `_` +// `\` RegExpUnicodeEscapeSequence[?U] +pp$9.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false +}; +function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ +} + +// RegExpIdentifierPart[U] :: +// UnicodeIDContinue +// `$` +// `_` +// `\` RegExpUnicodeEscapeSequence[?U] +// +// +pp$9.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false +}; +function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape +pp$9.regexp_eatAtomEscape = function(state) { + if ( + this.regexp_eatBackReference(state) || + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) || + (state.switchN && this.regexp_eatKGroupName(state)) + ) { + return true + } + if (state.switchU) { + // Make the same message as V8. + if (state.current() === 0x63 /* c */) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false +}; +pp$9.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true + } + if (n <= state.numCapturingParens) { + return true + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatKGroupName = function(state) { + if (state.eat(0x6B /* k */)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true + } + state.raise("Invalid named reference"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape +pp$9.regexp_eatCharacterEscape = function(state) { + return ( + this.regexp_eatControlEscape(state) || + this.regexp_eatCControlLetter(state) || + this.regexp_eatZero(state) || + this.regexp_eatHexEscapeSequence(state) || + this.regexp_eatRegExpUnicodeEscapeSequence(state) || + (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || + this.regexp_eatIdentityEscape(state) + ) +}; +pp$9.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat(0x63 /* c */)) { + if (this.regexp_eatControlLetter(state)) { + return true + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatZero = function(state) { + if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape +pp$9.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 0x74 /* t */) { + state.lastIntValue = 0x09; /* \t */ + state.advance(); + return true + } + if (ch === 0x6E /* n */) { + state.lastIntValue = 0x0A; /* \n */ + state.advance(); + return true + } + if (ch === 0x76 /* v */) { + state.lastIntValue = 0x0B; /* \v */ + state.advance(); + return true + } + if (ch === 0x66 /* f */) { + state.lastIntValue = 0x0C; /* \f */ + state.advance(); + return true + } + if (ch === 0x72 /* r */) { + state.lastIntValue = 0x0D; /* \r */ + state.advance(); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter +pp$9.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false +}; +function isControlLetter(ch) { + return ( + (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || + (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) + ) +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence +pp$9.regexp_eatRegExpUnicodeEscapeSequence = function(state) { + var start = state.pos; + + if (state.eat(0x75 /* u */)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) { + var leadSurrogateEnd = state.pos; + if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 0xDC00 && trail <= 0xDFFF) { + state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + return true + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true + } + if ( + state.switchU && + state.eat(0x7B /* { */) && + this.regexp_eatHexDigits(state) && + state.eat(0x7D /* } */) && + isValidUnicode(state.lastIntValue) + ) { + return true + } + if (state.switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start; + } + + return false +}; +function isValidUnicode(ch) { + return ch >= 0 && ch <= 0x10FFFF +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape +pp$9.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true + } + if (state.eat(0x2F /* / */)) { + state.lastIntValue = 0x2F; /* / */ + return true + } + return false + } + + var ch = state.current(); + if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape +pp$9.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape +pp$9.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true + } + + if ( + state.switchU && + this.options.ecmaVersion >= 9 && + (ch === 0x50 /* P */ || ch === 0x70 /* p */) + ) { + state.lastIntValue = -1; + state.advance(); + if ( + state.eat(0x7B /* { */) && + this.regexp_eatUnicodePropertyValueExpression(state) && + state.eat(0x7D /* } */) + ) { + return true + } + state.raise("Invalid property name"); + } + + return false +}; +function isCharacterClassEscape(ch) { + return ( + ch === 0x64 /* d */ || + ch === 0x44 /* D */ || + ch === 0x73 /* s */ || + ch === 0x53 /* S */ || + ch === 0x77 /* w */ || + ch === 0x57 /* W */ + ) +} + +// UnicodePropertyValueExpression :: +// UnicodePropertyName `=` UnicodePropertyValue +// LoneUnicodePropertyNameOrValue +pp$9.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; + + // UnicodePropertyName `=` UnicodePropertyValue + if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true + } + } + state.pos = start; + + // LoneUnicodePropertyNameOrValue + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true + } + return false +}; +pp$9.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!data.hasOwnProperty(name) || data[name].indexOf(value) === -1) { + state.raise("Invalid property name"); + } +}; +pp$9.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (data.$LONE.indexOf(nameOrValue) === -1) { + state.raise("Invalid property name"); + } +}; + +// UnicodePropertyName :: +// UnicodePropertyNameCharacters +pp$9.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString$1(ch); + state.advance(); + } + return state.lastStringValue !== "" +}; +function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 0x5F /* _ */ +} + +// UnicodePropertyValue :: +// UnicodePropertyValueCharacters +pp$9.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString$1(ch); + state.advance(); + } + return state.lastStringValue !== "" +}; +function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) +} + +// LoneUnicodePropertyNameOrValue :: +// UnicodePropertyValueCharacters +pp$9.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state) +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass +pp$9.regexp_eatCharacterClass = function(state) { + if (state.eat(0x5B /* [ */)) { + state.eat(0x5E /* ^ */); + this.regexp_classRanges(state); + if (state.eat(0x5D /* [ */)) { + return true + } + // Unreachable since it threw "unterminated regular expression" error before. + state.raise("Unterminated character class"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges +// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges +// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash +pp$9.regexp_classRanges = function(state) { + var this$1 = this; + + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this$1.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom +// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash +pp$9.regexp_eatClassAtom = function(state) { + var start = state.pos; + + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatClassEscape(state)) { + return true + } + if (state.switchU) { + // Make the same message as V8. + var ch$1 = state.current(); + if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; + } + + var ch = state.current(); + if (ch !== 0x5D /* [ */) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape +pp$9.regexp_eatClassEscape = function(state) { + var start = state.pos; + + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ + return true + } + + if (state.switchU && state.eat(0x2D /* - */)) { + state.lastIntValue = 0x2D; /* - */ + return true + } + + if (!state.switchU && state.eat(0x63 /* c */)) { + if (this.regexp_eatClassControlLetter(state)) { + return true + } + state.pos = start; + } + + return ( + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) + ) +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter +pp$9.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence +pp$9.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(0x78 /* x */)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits +pp$9.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } + return state.pos !== start +}; +function isDecimalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits +pp$9.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start +}; +function isHexDigit(ch) { + return ( + (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || + (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || + (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) + ) +} +function hexToInt(ch) { + if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { + return 10 + (ch - 0x41 /* A */) + } + if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { + return 10 + (ch - 0x61 /* a */) + } + return ch - 0x30 /* 0 */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence +// Allows only 0-377(octal) i.e. 0-255(decimal). +pp$9.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit +pp$9.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 0x30; /* 0 */ + state.advance(); + return true + } + state.lastIntValue = 0; + return false +}; +function isOctalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits +// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit +// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence +pp$9.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true +}; + +// Object type used to represent tokens. Note that normally, tokens +// simply exist as properties on the parser object. This is only +// used for the onToken callback and the external tokenizer. + +var Token = function Token(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) + { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } + if (p.options.ranges) + { this.range = [p.start, p.end]; } +}; + +// ## Tokenizer + +var pp$8 = Parser.prototype; + +// Move to the next token + +pp$8.next = function() { + if (this.options.onToken) + { this.options.onToken(new Token(this)); } + + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); +}; + +pp$8.getToken = function() { + this.next(); + return new Token(this) +}; + +// If we're in an ES6 environment, make parsers iterable +if (typeof Symbol !== "undefined") + { pp$8[Symbol.iterator] = function() { + var this$1 = this; + + return { + next: function () { + var token = this$1.getToken(); + return { + done: token.type === types.eof, + value: token + } + } + } + }; } + +// Toggle strict mode. Re-reads the next number or string to please +// pedantic tests (`"use strict"; 010;` should fail). + +pp$8.curContext = function() { + return this.context[this.context.length - 1] +}; + +// Read a single token, updating the parser object's token-related +// properties. + +pp$8.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } + + this.start = this.pos; + if (this.options.locations) { this.startLoc = this.curPosition(); } + if (this.pos >= this.input.length) { return this.finishToken(types.eof) } + + if (curContext.override) { return curContext.override(this) } + else { this.readToken(this.fullCharCodeAtPos()); } +}; + +pp$8.readToken = function(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) + { return this.readWord() } + + return this.getTokenFromCode(code) +}; + +pp$8.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 0xd7ff || code >= 0xe000) { return code } + var next = this.input.charCodeAt(this.pos + 1); + return (code << 10) + next - 0x35fdc00 +}; + +pp$8.skipBlockComment = function() { + var this$1 = this; + + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } + this.pos = end + 2; + if (this.options.locations) { + lineBreakG.lastIndex = start; + var match; + while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + ++this$1.curLine; + this$1.lineStart = match.index + match[0].length; + } + } + if (this.options.onComment) + { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, + startLoc, this.curPosition()); } +}; + +pp$8.skipLineComment = function(startSkip) { + var this$1 = this; + + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this$1.input.charCodeAt(++this$1.pos); + } + if (this.options.onComment) + { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, + startLoc, this.curPosition()); } +}; + +// Called at the start of the parse and after every token. Skips +// whitespace and comments, and. + +pp$8.skipSpace = function() { + var this$1 = this; + + loop: while (this.pos < this.input.length) { + var ch = this$1.input.charCodeAt(this$1.pos); + switch (ch) { + case 32: case 160: // ' ' + ++this$1.pos; + break + case 13: + if (this$1.input.charCodeAt(this$1.pos + 1) === 10) { + ++this$1.pos; + } + case 10: case 8232: case 8233: + ++this$1.pos; + if (this$1.options.locations) { + ++this$1.curLine; + this$1.lineStart = this$1.pos; + } + break + case 47: // '/' + switch (this$1.input.charCodeAt(this$1.pos + 1)) { + case 42: // '*' + this$1.skipBlockComment(); + break + case 47: + this$1.skipLineComment(2); + break + default: + break loop + } + break + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this$1.pos; + } else { + break loop + } + } + } +}; + +// Called at the end of every token. Sets `end`, `val`, and +// maintains `context` and `exprAllowed`, and skips the space after +// the token, so that the next one's `start` will point at the +// right position. + +pp$8.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { this.endLoc = this.curPosition(); } + var prevType = this.type; + this.type = type; + this.value = val; + + this.updateContext(prevType); +}; + +// ### Token reading + +// This is the function that is called to fetch the next token. It +// is somewhat obscure, because it works in character codes rather +// than characters, and because operator parsing has been inlined +// into it. +// +// All in the name of speed. +// +pp$8.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { return this.readNumber(true) } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' + this.pos += 3; + return this.finishToken(types.ellipsis) + } else { + ++this.pos; + return this.finishToken(types.dot) + } +}; + +pp$8.readToken_slash = function() { // '/' + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { ++this.pos; return this.readRegexp() } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.slash, 1) +}; + +pp$8.readToken_mult_modulo_exp = function(code) { // '%*' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types.star : types.modulo; + + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && code == 42 && next === 42) { + ++size; + tokentype = types.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + + if (next === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(tokentype, size) +}; + +pp$8.readToken_pipe_amp = function(code) { // '|&' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) +}; + +pp$8.readToken_caret = function() { // '^' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.bitwiseXOR, 1) +}; + +pp$8.readToken_plus_min = function(code) { // '+-' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next == 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) == 62 && + (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types.incDec, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) +}; + +pp$8.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) + } + if (next == 33 && code == 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) == 45 && + this.input.charCodeAt(this.pos + 3) == 45) { + // `` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types.incDec, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) +}; + +pp$8.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) + } + if (next == 33 && code == 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) == 45 && + this.input.charCodeAt(this.pos + 3) == 45) { + // `)/],[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"]); diff --git a/node_modules/async-limiter/coverage/lcov-report/sort-arrow-sprite.png b/node_modules/async-limiter/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 0000000..03f704a Binary files /dev/null and b/node_modules/async-limiter/coverage/lcov-report/sort-arrow-sprite.png differ diff --git a/node_modules/async-limiter/coverage/lcov-report/sorter.js b/node_modules/async-limiter/coverage/lcov-report/sorter.js new file mode 100644 index 0000000..6afb736 --- /dev/null +++ b/node_modules/async-limiter/coverage/lcov-report/sorter.js @@ -0,0 +1,156 @@ +var addSorting = (function () { + "use strict"; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { return document.querySelector('.coverage-summary table'); } + // returns the thead element of the summary table + function getTableHeader() { return getTable().querySelector('thead tr'); } + // returns the tbody element of the summary table + function getTableBody() { return getTable().querySelector('tbody'); } + // returns the th element for nth column + function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + el = getNthColumn(i).querySelector('.sorter'); + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/node_modules/async-limiter/coverage/lcov.info b/node_modules/async-limiter/coverage/lcov.info new file mode 100644 index 0000000..fbf36aa --- /dev/null +++ b/node_modules/async-limiter/coverage/lcov.info @@ -0,0 +1,74 @@ +TN: +SF:/Users/samuelreed/git/forks/async-throttle/index.js +FN:3,Queue +FN:22,(anonymous_2) +FN:23,(anonymous_3) +FN:31,(anonymous_4) +FN:36,(anonymous_5) +FN:55,(anonymous_6) +FN:62,done +FNF:7 +FNH:7 +FNDA:7,Queue +FNDA:3,(anonymous_2) +FNDA:13,(anonymous_3) +FNDA:19,(anonymous_4) +FNDA:45,(anonymous_5) +FNDA:6,(anonymous_6) +FNDA:13,done +DA:3,1 +DA:4,7 +DA:5,1 +DA:8,6 +DA:9,6 +DA:10,6 +DA:11,6 +DA:12,6 +DA:13,6 +DA:16,1 +DA:22,1 +DA:23,3 +DA:24,13 +DA:25,13 +DA:26,13 +DA:30,1 +DA:32,19 +DA:36,1 +DA:37,45 +DA:38,6 +DA:40,39 +DA:41,13 +DA:42,13 +DA:43,13 +DA:44,13 +DA:47,39 +DA:48,18 +DA:49,6 +DA:50,6 +DA:55,1 +DA:56,6 +DA:57,6 +DA:58,6 +DA:62,1 +DA:63,13 +DA:64,13 +DA:67,1 +LF:37 +LH:37 +BRDA:4,1,0,1 +BRDA:4,1,1,6 +BRDA:8,2,0,6 +BRDA:8,2,1,5 +BRDA:9,3,0,6 +BRDA:9,3,1,5 +BRDA:37,4,0,6 +BRDA:37,4,1,39 +BRDA:40,5,0,13 +BRDA:40,5,1,26 +BRDA:47,6,0,18 +BRDA:47,6,1,21 +BRDA:56,7,0,6 +BRDA:56,7,1,0 +BRF:14 +BRH:13 +end_of_record diff --git a/node_modules/async-limiter/index.js b/node_modules/async-limiter/index.js new file mode 100644 index 0000000..c9bd2f9 --- /dev/null +++ b/node_modules/async-limiter/index.js @@ -0,0 +1,67 @@ +'use strict'; + +function Queue(options) { + if (!(this instanceof Queue)) { + return new Queue(options); + } + + options = options || {}; + this.concurrency = options.concurrency || Infinity; + this.pending = 0; + this.jobs = []; + this.cbs = []; + this._done = done.bind(this); +} + +var arrayAddMethods = [ + 'push', + 'unshift', + 'splice' +]; + +arrayAddMethods.forEach(function(method) { + Queue.prototype[method] = function() { + var methodResult = Array.prototype[method].apply(this.jobs, arguments); + this._run(); + return methodResult; + }; +}); + +Object.defineProperty(Queue.prototype, 'length', { + get: function() { + return this.pending + this.jobs.length; + } +}); + +Queue.prototype._run = function() { + if (this.pending === this.concurrency) { + return; + } + if (this.jobs.length) { + var job = this.jobs.shift(); + this.pending++; + job(this._done); + this._run(); + } + + if (this.pending === 0) { + while (this.cbs.length !== 0) { + var cb = this.cbs.pop(); + process.nextTick(cb); + } + } +}; + +Queue.prototype.onDone = function(cb) { + if (typeof cb === 'function') { + this.cbs.push(cb); + this._run(); + } +}; + +function done() { + this.pending--; + this._run(); +} + +module.exports = Queue; diff --git a/node_modules/async-limiter/package.json b/node_modules/async-limiter/package.json new file mode 100644 index 0000000..9b6810e --- /dev/null +++ b/node_modules/async-limiter/package.json @@ -0,0 +1,69 @@ +{ + "_from": "async-limiter@~1.0.0", + "_id": "async-limiter@1.0.0", + "_inBundle": false, + "_integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "_location": "/async-limiter", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "async-limiter@~1.0.0", + "name": "async-limiter", + "escapedName": "async-limiter", + "rawSpec": "~1.0.0", + "saveSpec": null, + "fetchSpec": "~1.0.0" + }, + "_requiredBy": [ + "/ws" + ], + "_resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "_shasum": "78faed8c3d074ab81f22b4e985d79e8738f720f8", + "_spec": "async-limiter@~1.0.0", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/ws", + "author": { + "name": "Samuel Reed" + }, + "bugs": { + "url": "https://github.com/strml/async-limiter/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "asynchronous function queue with adjustable concurrency", + "devDependencies": { + "coveralls": "^2.11.2", + "eslint": "^4.6.1", + "eslint-plugin-mocha": "^4.11.0", + "intelli-espower-loader": "^1.0.1", + "istanbul": "^0.3.2", + "mocha": "^3.5.2", + "power-assert": "^1.4.4" + }, + "homepage": "https://github.com/strml/async-limiter#readme", + "keywords": [ + "throttle", + "async", + "limiter", + "asynchronous", + "job", + "task", + "concurrency", + "concurrent" + ], + "license": "MIT", + "name": "async-limiter", + "repository": { + "type": "git", + "url": "git+https://github.com/strml/async-limiter.git" + }, + "scripts": { + "coverage": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls", + "example": "node example", + "lint": "eslint .", + "test": "mocha --R intelli-espower-loader test/", + "travis": "npm run lint && npm run coverage" + }, + "version": "1.0.0" +} diff --git a/node_modules/async-limiter/readme.md b/node_modules/async-limiter/readme.md new file mode 100644 index 0000000..dcf4932 --- /dev/null +++ b/node_modules/async-limiter/readme.md @@ -0,0 +1,132 @@ +# Async-Limiter + +A module for limiting concurrent asynchronous actions in flight. Forked from [queue](https://github.com/jessetane/queue). + +[![npm](http://img.shields.io/npm/v/async-limiter.svg?style=flat-square)](http://www.npmjs.org/async-limiter) +[![tests](https://img.shields.io/travis/STRML/async-limiter.svg?style=flat-square&branch=master)](https://travis-ci.org/STRML/async-limiter) +[![coverage](https://img.shields.io/coveralls/STRML/async-limiter.svg?style=flat-square&branch=master)](https://coveralls.io/r/STRML/async-limiter) + +This module exports a class `Limiter` that implements some of the `Array` API. +Pass async functions (ones that accept a callback or return a promise) to an instance's additive array methods. + +## Motivation + +Certain functions, like `zlib`, have [undesirable behavior](https://github.com/nodejs/node/issues/8871#issuecomment-250915913) when +run at infinite concurrency. + +In this case, it is actually faster, and takes far less memory, to limit concurrency. + +This module should do the absolute minimum work necessary to queue up functions. PRs are welcome that would +make this module faster or lighter, but new functionality is not desired. + +Style should confirm to nodejs/node style. + +## Example + +``` javascript +var Limiter = require('async-limiter') + +var t = new Limiter({concurrency: 2}); +var results = [] + +// add jobs using the familiar Array API +t.push(function (cb) { + results.push('two') + cb() +}) + +t.push( + function (cb) { + results.push('four') + cb() + }, + function (cb) { + results.push('five') + cb() + } +) + +t.unshift(function (cb) { + results.push('one') + cb() +}) + +t.splice(2, 0, function (cb) { + results.push('three') + cb() +}) + +// Jobs run automatically. If you want a callback when all are done, +// call 'onDone()'. +t.onDone(function () { + console.log('all done:', results) +}) +``` + +## Zlib Example + +```js +const zlib = require('zlib'); +const Limiter = require('async-limiter'); + +const message = {some: "data"}; +const payload = new Buffer(JSON.stringify(message)); + +// Try with different concurrency values to see how this actually +// slows significantly with higher concurrency! +// +// 5: 1398.607ms +// 10: 1375.668ms +// Infinity: 4423.300ms +// +const t = new Limiter({concurrency: 5}); +function deflate(payload, cb) { + t.push(function(done) { + zlib.deflate(payload, function(err, buffer) { + done(); + cb(err, buffer); + }); + }); +} + +console.time('deflate'); +for(let i = 0; i < 30000; ++i) { + deflate(payload, function (err, buffer) {}); +} +q.onDone(function() { + console.timeEnd('deflate'); +}); +``` + +## Install + +`npm install async-limiter` + +## Test + +`npm test` + +## API + +### `var t = new Limiter([opts])` +Constructor. `opts` may contain inital values for: +* `q.concurrency` + +## Instance methods + +### `q.onDone(fn)` +`fn` will be called once and only once, when the queue is empty. + +## Instance methods mixed in from `Array` +Mozilla has docs on how these methods work [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array). +### `q.push(element1, ..., elementN)` +### `q.unshift(element1, ..., elementN)` +### `q.splice(index , howMany[, element1[, ...[, elementN]]])` + +## Properties +### `q.concurrency` +Max number of jobs the queue should process concurrently, defaults to `Infinity`. + +### `q.length` +Jobs pending + jobs to process (readonly). + diff --git a/node_modules/asynckit/LICENSE b/node_modules/asynckit/LICENSE new file mode 100644 index 0000000..c9eca5d --- /dev/null +++ b/node_modules/asynckit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Alex Indigo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/asynckit/README.md b/node_modules/asynckit/README.md new file mode 100644 index 0000000..ddcc7e6 --- /dev/null +++ b/node_modules/asynckit/README.md @@ -0,0 +1,233 @@ +# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit) + +Minimal async jobs utility library, with streams support. + +[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit) + +[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master) +[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit) +[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit) + + + +AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects. +Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method. + +It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators. + +| compression | size | +| :----------------- | -------: | +| asynckit.js | 12.34 kB | +| asynckit.min.js | 4.11 kB | +| asynckit.min.js.gz | 1.47 kB | + + +## Install + +```sh +$ npm install --save asynckit +``` + +## Examples + +### Parallel Jobs + +Runs iterator over provided array in parallel. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will terminate rest of the active jobs (if abort function is provided) +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var parallel = require('asynckit').parallel + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , target = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// async job accepts one element from the array +// and a callback function +function asyncJob(item, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var parallel = require('asynckit/parallel') + , assert = require('assert') + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ] + , target = [] + , keys = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); + assert.deepEqual(keys, expectedKeys); +}); + +// supports full value, key, callback (shortcut) interface +function asyncJob(item, key, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + keys.push(key); + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js). + +### Serial Jobs + +Runs iterator over provided array sequentially. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will not proceed to the rest of the items in the list +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var serial = require('asynckit/serial') + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// extended interface (item, key, callback) +// also supported for arrays +function asyncJob(item, key, cb) +{ + target.push(key); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-array.js](test/test-serial-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var serial = require('asynckit').serial + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , target = [] + ; + + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// shortcut interface (item, callback) +// works for object as well as for the arrays +function asyncJob(item, cb) +{ + target.push(item); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-object.js](test/test-serial-object.js). + +_Note: Since _object_ is an _unordered_ collection of properties, +it may produce unexpected results with sequential iterations. +Whenever order of the jobs' execution is important please use `serialOrdered` method._ + +### Ordered Serial Iterations + +TBD + +For example [compare-property](compare-property) package. + +### Streaming interface + +TBD + +## Want to Know More? + +More examples can be found in [test folder](test/). + +Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions. + +## License + +AsyncKit is licensed under the MIT license. diff --git a/node_modules/asynckit/bench.js b/node_modules/asynckit/bench.js new file mode 100644 index 0000000..c612f1a --- /dev/null +++ b/node_modules/asynckit/bench.js @@ -0,0 +1,76 @@ +/* eslint no-console: "off" */ + +var asynckit = require('./') + , async = require('async') + , assert = require('assert') + , expected = 0 + ; + +var Benchmark = require('benchmark'); +var suite = new Benchmark.Suite; + +var source = []; +for (var z = 1; z < 100; z++) +{ + source.push(z); + expected += z; +} + +suite +// add tests + +.add('async.map', function(deferred) +{ + var total = 0; + + async.map(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +.add('asynckit.parallel', function(deferred) +{ + var total = 0; + + asynckit.parallel(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +// add listeners +.on('cycle', function(ev) +{ + console.log(String(ev.target)); +}) +.on('complete', function() +{ + console.log('Fastest is ' + this.filter('fastest').map('name')); +}) +// run async +.run({ 'async': true }); diff --git a/node_modules/asynckit/index.js b/node_modules/asynckit/index.js new file mode 100644 index 0000000..455f945 --- /dev/null +++ b/node_modules/asynckit/index.js @@ -0,0 +1,6 @@ +module.exports = +{ + parallel : require('./parallel.js'), + serial : require('./serial.js'), + serialOrdered : require('./serialOrdered.js') +}; diff --git a/node_modules/asynckit/lib/abort.js b/node_modules/asynckit/lib/abort.js new file mode 100644 index 0000000..114367e --- /dev/null +++ b/node_modules/asynckit/lib/abort.js @@ -0,0 +1,29 @@ +// API +module.exports = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} diff --git a/node_modules/asynckit/lib/async.js b/node_modules/asynckit/lib/async.js new file mode 100644 index 0000000..7f1288a --- /dev/null +++ b/node_modules/asynckit/lib/async.js @@ -0,0 +1,34 @@ +var defer = require('./defer.js'); + +// API +module.exports = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} diff --git a/node_modules/asynckit/lib/defer.js b/node_modules/asynckit/lib/defer.js new file mode 100644 index 0000000..b67110c --- /dev/null +++ b/node_modules/asynckit/lib/defer.js @@ -0,0 +1,26 @@ +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} diff --git a/node_modules/asynckit/lib/iterate.js b/node_modules/asynckit/lib/iterate.js new file mode 100644 index 0000000..5d2839a --- /dev/null +++ b/node_modules/asynckit/lib/iterate.js @@ -0,0 +1,75 @@ +var async = require('./async.js') + , abort = require('./abort.js') + ; + +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); +} + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} diff --git a/node_modules/asynckit/lib/readable_asynckit.js b/node_modules/asynckit/lib/readable_asynckit.js new file mode 100644 index 0000000..78ad240 --- /dev/null +++ b/node_modules/asynckit/lib/readable_asynckit.js @@ -0,0 +1,91 @@ +var streamify = require('./streamify.js') + , defer = require('./defer.js') + ; + +// API +module.exports = ReadableAsyncKit; + +/** + * Base constructor for all streams + * used to hold properties/methods + */ +function ReadableAsyncKit() +{ + ReadableAsyncKit.super_.apply(this, arguments); + + // list of active jobs + this.jobs = {}; + + // add stream methods + this.destroy = destroy; + this._start = _start; + this._read = _read; +} + +/** + * Destroys readable stream, + * by aborting outstanding jobs + * + * @returns {void} + */ +function destroy() +{ + if (this.destroyed) + { + return; + } + + this.destroyed = true; + + if (typeof this.terminator == 'function') + { + this.terminator(); + } +} + +/** + * Starts provided jobs in async manner + * + * @private + */ +function _start() +{ + // first argument – runner function + var runner = arguments[0] + // take away first argument + , args = Array.prototype.slice.call(arguments, 1) + // second argument - input data + , input = args[0] + // last argument - result callback + , endCb = streamify.callback.call(this, args[args.length - 1]) + ; + + args[args.length - 1] = endCb; + // third argument - iterator + args[1] = streamify.iterator.call(this, args[1]); + + // allow time for proper setup + defer(function() + { + if (!this.destroyed) + { + this.terminator = runner.apply(null, args); + } + else + { + endCb(null, Array.isArray(input) ? [] : {}); + } + }.bind(this)); +} + + +/** + * Implement _read to comply with Readable streams + * Doesn't really make sense for flowing object mode + * + * @private + */ +function _read() +{ + +} diff --git a/node_modules/asynckit/lib/readable_parallel.js b/node_modules/asynckit/lib/readable_parallel.js new file mode 100644 index 0000000..5d2929f --- /dev/null +++ b/node_modules/asynckit/lib/readable_parallel.js @@ -0,0 +1,25 @@ +var parallel = require('../parallel.js'); + +// API +module.exports = ReadableParallel; + +/** + * Streaming wrapper to `asynckit.parallel` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableParallel(list, iterator, callback) +{ + if (!(this instanceof ReadableParallel)) + { + return new ReadableParallel(list, iterator, callback); + } + + // turn on object mode + ReadableParallel.super_.call(this, {objectMode: true}); + + this._start(parallel, list, iterator, callback); +} diff --git a/node_modules/asynckit/lib/readable_serial.js b/node_modules/asynckit/lib/readable_serial.js new file mode 100644 index 0000000..7822698 --- /dev/null +++ b/node_modules/asynckit/lib/readable_serial.js @@ -0,0 +1,25 @@ +var serial = require('../serial.js'); + +// API +module.exports = ReadableSerial; + +/** + * Streaming wrapper to `asynckit.serial` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerial(list, iterator, callback) +{ + if (!(this instanceof ReadableSerial)) + { + return new ReadableSerial(list, iterator, callback); + } + + // turn on object mode + ReadableSerial.super_.call(this, {objectMode: true}); + + this._start(serial, list, iterator, callback); +} diff --git a/node_modules/asynckit/lib/readable_serial_ordered.js b/node_modules/asynckit/lib/readable_serial_ordered.js new file mode 100644 index 0000000..3de89c4 --- /dev/null +++ b/node_modules/asynckit/lib/readable_serial_ordered.js @@ -0,0 +1,29 @@ +var serialOrdered = require('../serialOrdered.js'); + +// API +module.exports = ReadableSerialOrdered; +// expose sort helpers +module.exports.ascending = serialOrdered.ascending; +module.exports.descending = serialOrdered.descending; + +/** + * Streaming wrapper to `asynckit.serialOrdered` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerialOrdered(list, iterator, sortMethod, callback) +{ + if (!(this instanceof ReadableSerialOrdered)) + { + return new ReadableSerialOrdered(list, iterator, sortMethod, callback); + } + + // turn on object mode + ReadableSerialOrdered.super_.call(this, {objectMode: true}); + + this._start(serialOrdered, list, iterator, sortMethod, callback); +} diff --git a/node_modules/asynckit/lib/state.js b/node_modules/asynckit/lib/state.js new file mode 100644 index 0000000..cbea7ad --- /dev/null +++ b/node_modules/asynckit/lib/state.js @@ -0,0 +1,37 @@ +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} diff --git a/node_modules/asynckit/lib/streamify.js b/node_modules/asynckit/lib/streamify.js new file mode 100644 index 0000000..f56a1c9 --- /dev/null +++ b/node_modules/asynckit/lib/streamify.js @@ -0,0 +1,141 @@ +var async = require('./async.js'); + +// API +module.exports = { + iterator: wrapIterator, + callback: wrapCallback +}; + +/** + * Wraps iterators with long signature + * + * @this ReadableAsyncKit# + * @param {function} iterator - function to wrap + * @returns {function} - wrapped function + */ +function wrapIterator(iterator) +{ + var stream = this; + + return function(item, key, cb) + { + var aborter + , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key)) + ; + + stream.jobs[key] = wrappedCb; + + // it's either shortcut (item, cb) + if (iterator.length == 2) + { + aborter = iterator(item, wrappedCb); + } + // or long format (item, key, cb) + else + { + aborter = iterator(item, key, wrappedCb); + } + + return aborter; + }; +} + +/** + * Wraps provided callback function + * allowing to execute snitch function before + * real callback + * + * @this ReadableAsyncKit# + * @param {function} callback - function to wrap + * @returns {function} - wrapped function + */ +function wrapCallback(callback) +{ + var stream = this; + + var wrapped = function(error, result) + { + return finisher.call(stream, error, result, callback); + }; + + return wrapped; +} + +/** + * Wraps provided iterator callback function + * makes sure snitch only called once, + * but passes secondary calls to the original callback + * + * @this ReadableAsyncKit# + * @param {function} callback - callback to wrap + * @param {number|string} key - iteration key + * @returns {function} wrapped callback + */ +function wrapIteratorCallback(callback, key) +{ + var stream = this; + + return function(error, output) + { + // don't repeat yourself + if (!(key in stream.jobs)) + { + callback(error, output); + return; + } + + // clean up jobs + delete stream.jobs[key]; + + return streamer.call(stream, error, {key: key, value: output}, callback); + }; +} + +/** + * Stream wrapper for iterator callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects iterator results + */ +function streamer(error, output, callback) +{ + if (error && !this.error) + { + this.error = error; + this.pause(); + this.emit('error', error); + // send back value only, as expected + callback(error, output && output.value); + return; + } + + // stream stuff + this.push(output); + + // back to original track + // send back value only, as expected + callback(error, output && output.value); +} + +/** + * Stream wrapper for finishing callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects final results + */ +function finisher(error, output, callback) +{ + // signal end of the stream + // only for successfully finished streams + if (!error) + { + this.push(null); + } + + // back to original track + callback(error, output); +} diff --git a/node_modules/asynckit/lib/terminator.js b/node_modules/asynckit/lib/terminator.js new file mode 100644 index 0000000..d6eb992 --- /dev/null +++ b/node_modules/asynckit/lib/terminator.js @@ -0,0 +1,29 @@ +var abort = require('./abort.js') + , async = require('./async.js') + ; + +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} diff --git a/node_modules/asynckit/package.json b/node_modules/asynckit/package.json new file mode 100644 index 0000000..feca036 --- /dev/null +++ b/node_modules/asynckit/package.json @@ -0,0 +1,91 @@ +{ + "_from": "asynckit@^0.4.0", + "_id": "asynckit@0.4.0", + "_inBundle": false, + "_integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "_location": "/asynckit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "asynckit@^0.4.0", + "name": "asynckit", + "escapedName": "asynckit", + "rawSpec": "^0.4.0", + "saveSpec": null, + "fetchSpec": "^0.4.0" + }, + "_requiredBy": [ + "/form-data" + ], + "_resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "_shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79", + "_spec": "asynckit@^0.4.0", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/form-data", + "author": { + "name": "Alex Indigo", + "email": "iam@alexindigo.com" + }, + "bugs": { + "url": "https://github.com/alexindigo/asynckit/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Minimal async jobs utility library, with streams support", + "devDependencies": { + "browserify": "^13.0.0", + "browserify-istanbul": "^2.0.0", + "coveralls": "^2.11.9", + "eslint": "^2.9.0", + "istanbul": "^0.4.3", + "obake": "^0.1.2", + "phantomjs-prebuilt": "^2.1.7", + "pre-commit": "^1.1.3", + "reamde": "^1.1.0", + "rimraf": "^2.5.2", + "size-table": "^0.2.0", + "tap-spec": "^4.1.1", + "tape": "^4.5.1" + }, + "homepage": "https://github.com/alexindigo/asynckit#readme", + "keywords": [ + "async", + "jobs", + "parallel", + "serial", + "iterator", + "array", + "object", + "stream", + "destroy", + "terminate", + "abort" + ], + "license": "MIT", + "main": "index.js", + "name": "asynckit", + "pre-commit": [ + "clean", + "lint", + "test", + "browser", + "report", + "size" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/alexindigo/asynckit.git" + }, + "scripts": { + "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec", + "clean": "rimraf coverage", + "debug": "tape test/test-*.js", + "lint": "eslint *.js lib/*.js test/*.js", + "report": "istanbul report", + "size": "browserify index.js | size-table asynckit", + "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec", + "win-test": "tape test/test-*.js" + }, + "version": "0.4.0" +} diff --git a/node_modules/asynckit/parallel.js b/node_modules/asynckit/parallel.js new file mode 100644 index 0000000..3c50344 --- /dev/null +++ b/node_modules/asynckit/parallel.js @@ -0,0 +1,43 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} diff --git a/node_modules/asynckit/serial.js b/node_modules/asynckit/serial.js new file mode 100644 index 0000000..6cd949a --- /dev/null +++ b/node_modules/asynckit/serial.js @@ -0,0 +1,17 @@ +var serialOrdered = require('./serialOrdered.js'); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} diff --git a/node_modules/asynckit/serialOrdered.js b/node_modules/asynckit/serialOrdered.js new file mode 100644 index 0000000..607eafe --- /dev/null +++ b/node_modules/asynckit/serialOrdered.js @@ -0,0 +1,75 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} diff --git a/node_modules/asynckit/stream.js b/node_modules/asynckit/stream.js new file mode 100644 index 0000000..d43465f --- /dev/null +++ b/node_modules/asynckit/stream.js @@ -0,0 +1,21 @@ +var inherits = require('util').inherits + , Readable = require('stream').Readable + , ReadableAsyncKit = require('./lib/readable_asynckit.js') + , ReadableParallel = require('./lib/readable_parallel.js') + , ReadableSerial = require('./lib/readable_serial.js') + , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js') + ; + +// API +module.exports = +{ + parallel : ReadableParallel, + serial : ReadableSerial, + serialOrdered : ReadableSerialOrdered, +}; + +inherits(ReadableAsyncKit, Readable); + +inherits(ReadableParallel, ReadableAsyncKit); +inherits(ReadableSerial, ReadableAsyncKit); +inherits(ReadableSerialOrdered, ReadableAsyncKit); diff --git a/node_modules/aws-sign2/LICENSE b/node_modules/aws-sign2/LICENSE new file mode 100644 index 0000000..a4a9aee --- /dev/null +++ b/node_modules/aws-sign2/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/node_modules/aws-sign2/README.md b/node_modules/aws-sign2/README.md new file mode 100644 index 0000000..763564e --- /dev/null +++ b/node_modules/aws-sign2/README.md @@ -0,0 +1,4 @@ +aws-sign +======== + +AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module. diff --git a/node_modules/aws-sign2/index.js b/node_modules/aws-sign2/index.js new file mode 100644 index 0000000..fb35f6d --- /dev/null +++ b/node_modules/aws-sign2/index.js @@ -0,0 +1,212 @@ + +/*! + * Copyright 2010 LearnBoost + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Module dependencies. + */ + +var crypto = require('crypto') + , parse = require('url').parse + ; + +/** + * Valid keys. + */ + +var keys = + [ 'acl' + , 'location' + , 'logging' + , 'notification' + , 'partNumber' + , 'policy' + , 'requestPayment' + , 'torrent' + , 'uploadId' + , 'uploads' + , 'versionId' + , 'versioning' + , 'versions' + , 'website' + ] + +/** + * Return an "Authorization" header value with the given `options` + * in the form of "AWS :" + * + * @param {Object} options + * @return {String} + * @api private + */ + +function authorization (options) { + return 'AWS ' + options.key + ':' + sign(options) +} + +module.exports = authorization +module.exports.authorization = authorization + +/** + * Simple HMAC-SHA1 Wrapper + * + * @param {Object} options + * @return {String} + * @api private + */ + +function hmacSha1 (options) { + return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') +} + +module.exports.hmacSha1 = hmacSha1 + +/** + * Create a base64 sha1 HMAC for `options`. + * + * @param {Object} options + * @return {String} + * @api private + */ + +function sign (options) { + options.message = stringToSign(options) + return hmacSha1(options) +} +module.exports.sign = sign + +/** + * Create a base64 sha1 HMAC for `options`. + * + * Specifically to be used with S3 presigned URLs + * + * @param {Object} options + * @return {String} + * @api private + */ + +function signQuery (options) { + options.message = queryStringToSign(options) + return hmacSha1(options) +} +module.exports.signQuery= signQuery + +/** + * Return a string for sign() with the given `options`. + * + * Spec: + * + * \n + * \n + * \n + * \n + * [headers\n] + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function stringToSign (options) { + var headers = options.amazonHeaders || '' + if (headers) headers += '\n' + var r = + [ options.verb + , options.md5 + , options.contentType + , options.date ? options.date.toUTCString() : '' + , headers + options.resource + ] + return r.join('\n') +} +module.exports.stringToSign = stringToSign + +/** + * Return a string for sign() with the given `options`, but is meant exclusively + * for S3 presigned URLs + * + * Spec: + * + * \n + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function queryStringToSign (options){ + return 'GET\n\n\n' + options.date + '\n' + options.resource +} +module.exports.queryStringToSign = queryStringToSign + +/** + * Perform the following: + * + * - ignore non-amazon headers + * - lowercase fields + * - sort lexicographically + * - trim whitespace between ":" + * - join with newline + * + * @param {Object} headers + * @return {String} + * @api private + */ + +function canonicalizeHeaders (headers) { + var buf = [] + , fields = Object.keys(headers) + ; + for (var i = 0, len = fields.length; i < len; ++i) { + var field = fields[i] + , val = headers[field] + , field = field.toLowerCase() + ; + if (0 !== field.indexOf('x-amz')) continue + buf.push(field + ':' + val) + } + return buf.sort().join('\n') +} +module.exports.canonicalizeHeaders = canonicalizeHeaders + +/** + * Perform the following: + * + * - ignore non sub-resources + * - sort lexicographically + * + * @param {String} resource + * @return {String} + * @api private + */ + +function canonicalizeResource (resource) { + var url = parse(resource, true) + , path = url.pathname + , buf = [] + ; + + Object.keys(url.query).forEach(function(key){ + if (!~keys.indexOf(key)) return + var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) + buf.push(key + val) + }) + + return path + (buf.length ? '?' + buf.sort().join('&') : '') +} +module.exports.canonicalizeResource = canonicalizeResource diff --git a/node_modules/aws-sign2/package.json b/node_modules/aws-sign2/package.json new file mode 100644 index 0000000..46426bc --- /dev/null +++ b/node_modules/aws-sign2/package.json @@ -0,0 +1,50 @@ +{ + "_from": "aws-sign2@~0.7.0", + "_id": "aws-sign2@0.7.0", + "_inBundle": false, + "_integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "_location": "/aws-sign2", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aws-sign2@~0.7.0", + "name": "aws-sign2", + "escapedName": "aws-sign2", + "rawSpec": "~0.7.0", + "saveSpec": null, + "fetchSpec": "~0.7.0" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "_shasum": "b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8", + "_spec": "aws-sign2@~0.7.0", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/request", + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "bugs": { + "url": "https://github.com/mikeal/aws-sign/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", + "devDependencies": {}, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/mikeal/aws-sign#readme", + "license": "Apache-2.0", + "main": "index.js", + "name": "aws-sign2", + "optionalDependencies": {}, + "repository": { + "url": "git+https://github.com/mikeal/aws-sign.git" + }, + "version": "0.7.0" +} diff --git a/node_modules/aws4/.travis.yml b/node_modules/aws4/.travis.yml new file mode 100644 index 0000000..61d0634 --- /dev/null +++ b/node_modules/aws4/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - "4.2" diff --git a/node_modules/aws4/LICENSE b/node_modules/aws4/LICENSE new file mode 100644 index 0000000..4f321e5 --- /dev/null +++ b/node_modules/aws4/LICENSE @@ -0,0 +1,19 @@ +Copyright 2013 Michael Hart (michael.hart.au@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/aws4/README.md b/node_modules/aws4/README.md new file mode 100644 index 0000000..6b002d0 --- /dev/null +++ b/node_modules/aws4/README.md @@ -0,0 +1,523 @@ +aws4 +---- + +[![Build Status](https://secure.travis-ci.org/mhart/aws4.png?branch=master)](http://travis-ci.org/mhart/aws4) + +A small utility to sign vanilla node.js http(s) request options using Amazon's +[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html). + +Can also be used [in the browser](./browser). + +This signature is supported by nearly all Amazon services, including +[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/), +[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/), +[DynamoDB](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API.html), +[Kinesis](http://docs.aws.amazon.com/kinesis/latest/APIReference/), +[Lambda](http://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html), +[SQS](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/), +[SNS](http://docs.aws.amazon.com/sns/latest/api/), +[IAM](http://docs.aws.amazon.com/IAM/latest/APIReference/), +[STS](http://docs.aws.amazon.com/STS/latest/APIReference/), +[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/), +[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/), +[CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/), +[CodeDeploy](http://docs.aws.amazon.com/codedeploy/latest/APIReference/), +[CloudFront](http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/), +[CloudTrail](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/), +[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/), +[EMR](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/), +[Glacier](http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-api.html), +[CloudSearch](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/APIReq.html), +[Elastic Load Balancing](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/), +[Elastic Transcoder](http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html), +[CloudFormation](http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/), +[Elastic Beanstalk](http://docs.aws.amazon.com/elasticbeanstalk/latest/api/), +[Storage Gateway](http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html), +[Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/APIReference/), +[Direct Connect](http://docs.aws.amazon.com/directconnect/latest/APIReference/), +[Redshift](http://docs.aws.amazon.com/redshift/latest/APIReference/), +[OpsWorks](http://docs.aws.amazon.com/opsworks/latest/APIReference/), +[SES](http://docs.aws.amazon.com/ses/latest/APIReference/), +[SWF](http://docs.aws.amazon.com/amazonswf/latest/apireference/), +[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/), +[Mobile Analytics](http://docs.aws.amazon.com/mobileanalytics/latest/ug/server-reference.html), +[Cognito Identity](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/), +[Cognito Sync](http://docs.aws.amazon.com/cognitosync/latest/APIReference/), +[Container Service](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/), +[AppStream](http://docs.aws.amazon.com/appstream/latest/developerguide/appstream-api-rest.html), +[Key Management Service](http://docs.aws.amazon.com/kms/latest/APIReference/), +[Config](http://docs.aws.amazon.com/config/latest/APIReference/), +[CloudHSM](http://docs.aws.amazon.com/cloudhsm/latest/dg/api-ref.html), +[Route53](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rest.html) and +[Route53 Domains](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html). + +Indeed, the only AWS services that *don't* support v4 as of 2014-12-30 are +[Import/Export](http://docs.aws.amazon.com/AWSImportExport/latest/DG/api-reference.html) and +[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html) +(they only support [AWS Signature Version 2](https://github.com/mhart/aws2)). + +It also provides defaults for a number of core AWS headers and +request parameters, making it very easy to query AWS services, or +build out a fully-featured AWS library. + +Example +------- + +```javascript +var http = require('http'), + https = require('https'), + aws4 = require('aws4') + +// given an options object you could pass to http.request +var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'} + +// alternatively (as aws4 can infer the host): +opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'} + +// alternatively (as us-east-1 is default): +opts = {service: 'sqs', path: '/?Action=ListQueues'} + +aws4.sign(opts) // assumes AWS credentials are available in process.env + +console.log(opts) +/* +{ + host: 'sqs.us-east-1.amazonaws.com', + path: '/?Action=ListQueues', + headers: { + Host: 'sqs.us-east-1.amazonaws.com', + 'X-Amz-Date': '20121226T061030Z', + Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...' + } +} +*/ + +// we can now use this to query AWS using the standard node.js http API +http.request(opts, function(res) { res.pipe(process.stdout) }).end() +/* + + +... +*/ +``` + +More options +------------ + +```javascript +// you can also pass AWS credentials in explicitly (otherwise taken from process.env) +aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''}) + +// can also add the signature to query strings +aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true}) + +// create a utility function to pipe to stdout (with https this time) +function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') } + +// aws4 can infer the HTTP method if a body is passed in +// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8' +request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'})) +/* + +... +*/ + +// can specify any custom option or header as per usual +request(aws4.sign({ + service: 'dynamodb', + region: 'ap-southeast-2', + method: 'POST', + path: '/', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'DynamoDB_20120810.ListTables' + }, + body: '{}' +})) +/* +{"TableNames":[]} +... +*/ + +// works with all other services that support Signature Version 4 + +request(aws4.sign({service: 's3', path: '/', signQuery: true})) +/* + +... +*/ + +request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'})) +/* + +... +*/ + +request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'})) +/* + +... +*/ + +request(aws4.sign({service: 'appstream', path: '/applications'})) +/* +{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/... +... +*/ + +request(aws4.sign({service: 'cognito-sync', path: '/identitypools'})) +/* +{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null} +... +*/ + +request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'})) +/* +{"NextPageToken":null,"Pipelines":[]} +... +*/ + +request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'})) +/* +{"Functions":[],"NextMarker":null} +... +*/ + +request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'})) +/* + +... +*/ + +request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}})) +/* +{"Marker":null,"VaultList":[]} +... +*/ + +request(aws4.sign({service: 'storagegateway', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StorageGateway_20120630.ListGateways' +}})) +/* +{"Gateways":[]} +... +*/ + +request(aws4.sign({service: 'datapipeline', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'DataPipeline.ListPipelines' +}})) +/* +{"hasMoreResults":false,"pipelineIdList":[]} +... +*/ + +request(aws4.sign({service: 'opsworks', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks' +}})) +/* +{"Stacks":[]} +... +*/ + +request(aws4.sign({service: 'route53domains', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains' +}})) +/* +{"Domains":[]} +... +*/ + +request(aws4.sign({service: 'kinesis', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Kinesis_20131202.ListStreams' +}})) +/* +{"HasMoreStreams":false,"StreamNames":[]} +... +*/ + +request(aws4.sign({service: 'cloudtrail', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails' +}})) +/* +{"trailList":[]} +... +*/ + +request(aws4.sign({service: 'logs', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups' +}})) +/* +{"logGroups":[]} +... +*/ + +request(aws4.sign({service: 'codedeploy', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications' +}})) +/* +{"applications":[]} +... +*/ + +request(aws4.sign({service: 'directconnect', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OvertureService.DescribeConnections' +}})) +/* +{"connections":[]} +... +*/ + +request(aws4.sign({service: 'kms', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'TrentService.ListKeys' +}})) +/* +{"Keys":[],"Truncated":false} +... +*/ + +request(aws4.sign({service: 'config', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels' +}})) +/* +{"DeliveryChannels":[]} +... +*/ + +request(aws4.sign({service: 'cloudhsm', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones' +}})) +/* +{"AZList":["us-east-1a","us-east-1b","us-east-1c"]} +... +*/ + +request(aws4.sign({ + service: 'swf', + body: '{"registrationStatus":"REGISTERED"}', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'SimpleWorkflowService.ListDomains' + } +})) +/* +{"domainInfos":[]} +... +*/ + +request(aws4.sign({ + service: 'cognito-identity', + body: '{"MaxResults": 1}', + headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools' + } +})) +/* +{"IdentityPools":[]} +... +*/ + +request(aws4.sign({ + service: 'mobileanalytics', + path: '/2014-06-05/events', + body: JSON.stringify({events:[{ + eventType: 'a', + timestamp: new Date().toISOString(), + session: {}, + }]}), + headers: { + 'Content-Type': 'application/json', + 'X-Amz-Client-Context': JSON.stringify({ + client: {client_id: 'a', app_title: 'a'}, + custom: {}, + env: {platform: 'a'}, + services: {}, + }), + } +})) +/* +(HTTP 202, empty response) +*/ + +// Generate CodeCommit Git access password +var signer = new aws4.RequestSigner({ + service: 'codecommit', + host: 'git-codecommit.us-east-1.amazonaws.com', + method: 'GIT', + path: '/v1/repos/MyAwesomeRepo', +}) +var password = signer.getDateTime() + 'Z' + signer.signature() +``` + +API +--- + +### aws4.sign(requestOptions, [credentials]) + +This calculates and populates the `Authorization` header of +`requestOptions`, and any other necessary AWS headers and/or request +options. Returns `requestOptions` as a convenience for chaining. + +`requestOptions` is an object holding the same options that the node.js +[http.request](http://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback) +function takes. + +The following properties of `requestOptions` are used in the signing or +populated if they don't already exist: + +- `hostname` or `host` (will be determined from `service` and `region` if not given) +- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`) +- `path` (will use `'/'` if not given) +- `body` (will use `''` if not given) +- `service` (will be calculated from `hostname` or `host` if not given) +- `region` (will be calculated from `hostname` or `host` or use `'us-east-1'` if not given) +- `headers['Host']` (will use `hostname` or `host` or be calculated if not given) +- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'` + if not given and there is a `body`) +- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used) + +Your AWS credentials (which can be found in your +[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials)) +can be specified in one of two ways: + +- As the second argument, like this: + +```javascript +aws4.sign(requestOptions, { + secretAccessKey: "", + accessKeyId: "", + sessionToken: "" +}) +``` + +- From `process.env`, such as this: + +``` +export AWS_SECRET_ACCESS_KEY="" +export AWS_ACCESS_KEY_ID="" +export AWS_SESSION_TOKEN="" +``` + +(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available) + +The `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing +with [IAM STS temporary credentials](http://docs.aws.amazon.com/STS/latest/UsingSTS/using-temp-creds.html). + +Installation +------------ + +With [npm](http://npmjs.org/) do: + +``` +npm install aws4 +``` + +Can also be used [in the browser](./browser). + +Thanks +------ + +Thanks to [@jed](https://github.com/jed) for his +[dynamo-client](https://github.com/jed/dynamo-client) lib where I first +committed and subsequently extracted this code. + +Also thanks to the +[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving +me a start on implementing the v4 signature. + diff --git a/node_modules/aws4/aws4.js b/node_modules/aws4/aws4.js new file mode 100644 index 0000000..8e73d44 --- /dev/null +++ b/node_modules/aws4/aws4.js @@ -0,0 +1,332 @@ +var aws4 = exports, + url = require('url'), + querystring = require('querystring'), + crypto = require('crypto'), + lru = require('./lru'), + credentialsCache = lru(1000) + +// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html + +function hmac(key, string, encoding) { + return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) +} + +function hash(string, encoding) { + return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) +} + +// This function assumes the string has already been percent encoded +function encodeRfc3986(urlEncodedString) { + return urlEncodedString.replace(/[!'()*]/g, function(c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +// request: { path | body, [host], [method], [headers], [service], [region] } +// credentials: { accessKeyId, secretAccessKey, [sessionToken] } +function RequestSigner(request, credentials) { + + if (typeof request === 'string') request = url.parse(request) + + var headers = request.headers = (request.headers || {}), + hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host) + + this.request = request + this.credentials = credentials || this.defaultCredentials() + + this.service = request.service || hostParts[0] || '' + this.region = request.region || hostParts[1] || 'us-east-1' + + // SES uses a different domain from the service name + if (this.service === 'email') this.service = 'ses' + + if (!request.method && request.body) + request.method = 'POST' + + if (!headers.Host && !headers.host) { + headers.Host = request.hostname || request.host || this.createHost() + + // If a port is specified explicitly, use it as is + if (request.port) + headers.Host += ':' + request.port + } + if (!request.hostname && !request.host) + request.hostname = headers.Host || headers.host + + this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' +} + +RequestSigner.prototype.matchHost = function(host) { + var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/) + var hostParts = (match || []).slice(1, 3) + + // ES's hostParts are sometimes the other way round, if the value that is expected + // to be region equals ‘es’ switch them back + // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com + if (hostParts[1] === 'es') + hostParts = hostParts.reverse() + + return hostParts +} + +// http://docs.aws.amazon.com/general/latest/gr/rande.html +RequestSigner.prototype.isSingleRegion = function() { + // Special case for S3 and SimpleDB in us-east-1 + if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true + + return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] + .indexOf(this.service) >= 0 +} + +RequestSigner.prototype.createHost = function() { + var region = this.isSingleRegion() ? '' : + (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, + service = this.service === 'ses' ? 'email' : this.service + return service + region + '.amazonaws.com' +} + +RequestSigner.prototype.prepareRequest = function() { + this.parsePath() + + var request = this.request, headers = request.headers, query + + if (request.signQuery) { + + this.parsedPath.query = query = this.parsedPath.query || {} + + if (this.credentials.sessionToken) + query['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !query['X-Amz-Expires']) + query['X-Amz-Expires'] = 86400 + + if (query['X-Amz-Date']) + this.datetime = query['X-Amz-Date'] + else + query['X-Amz-Date'] = this.getDateTime() + + query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' + query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() + query['X-Amz-SignedHeaders'] = this.signedHeaders() + + } else { + + if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { + if (request.body && !headers['Content-Type'] && !headers['content-type']) + headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' + + if (request.body && !headers['Content-Length'] && !headers['content-length']) + headers['Content-Length'] = Buffer.byteLength(request.body) + + if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) + headers['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) + headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') + + if (headers['X-Amz-Date'] || headers['x-amz-date']) + this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] + else + headers['X-Amz-Date'] = this.getDateTime() + } + + delete headers.Authorization + delete headers.authorization + } +} + +RequestSigner.prototype.sign = function() { + if (!this.parsedPath) this.prepareRequest() + + if (this.request.signQuery) { + this.parsedPath.query['X-Amz-Signature'] = this.signature() + } else { + this.request.headers.Authorization = this.authHeader() + } + + this.request.path = this.formatPath() + + return this.request +} + +RequestSigner.prototype.getDateTime = function() { + if (!this.datetime) { + var headers = this.request.headers, + date = new Date(headers.Date || headers.date || new Date) + + this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') + + // Remove the trailing 'Z' on the timestamp string for CodeCommit git access + if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) + } + return this.datetime +} + +RequestSigner.prototype.getDate = function() { + return this.getDateTime().substr(0, 8) +} + +RequestSigner.prototype.authHeader = function() { + return [ + 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), + 'SignedHeaders=' + this.signedHeaders(), + 'Signature=' + this.signature(), + ].join(', ') +} + +RequestSigner.prototype.signature = function() { + var date = this.getDate(), + cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), + kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) + if (!kCredentials) { + kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) + kRegion = hmac(kDate, this.region) + kService = hmac(kRegion, this.service) + kCredentials = hmac(kService, 'aws4_request') + credentialsCache.set(cacheKey, kCredentials) + } + return hmac(kCredentials, this.stringToSign(), 'hex') +} + +RequestSigner.prototype.stringToSign = function() { + return [ + 'AWS4-HMAC-SHA256', + this.getDateTime(), + this.credentialString(), + hash(this.canonicalString(), 'hex'), + ].join('\n') +} + +RequestSigner.prototype.canonicalString = function() { + if (!this.parsedPath) this.prepareRequest() + + var pathStr = this.parsedPath.path, + query = this.parsedPath.query, + headers = this.request.headers, + queryStr = '', + normalizePath = this.service !== 's3', + decodePath = this.service === 's3' || this.request.doNotEncodePath, + decodeSlashesInPath = this.service === 's3', + firstValOnly = this.service === 's3', + bodyHash + + if (this.service === 's3' && this.request.signQuery) { + bodyHash = 'UNSIGNED-PAYLOAD' + } else if (this.isCodeCommitGit) { + bodyHash = '' + } else { + bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || + hash(this.request.body || '', 'hex') + } + + if (query) { + queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { + if (!key) return obj + obj[key] = !Array.isArray(query[key]) ? query[key] : + (firstValOnly ? query[key][0] : query[key].slice().sort()) + return obj + }, {}))) + } + if (pathStr !== '/') { + if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') + pathStr = pathStr.split('/').reduce(function(path, piece) { + if (normalizePath && piece === '..') { + path.pop() + } else if (!normalizePath || piece !== '.') { + if (decodePath) piece = decodeURIComponent(piece) + path.push(encodeRfc3986(encodeURIComponent(piece))) + } + return path + }, []).join('/') + if (pathStr[0] !== '/') pathStr = '/' + pathStr + if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') + } + + return [ + this.request.method || 'GET', + pathStr, + queryStr, + this.canonicalHeaders() + '\n', + this.signedHeaders(), + bodyHash, + ].join('\n') +} + +RequestSigner.prototype.canonicalHeaders = function() { + var headers = this.request.headers + function trimAll(header) { + return header.toString().trim().replace(/\s+/g, ' ') + } + return Object.keys(headers) + .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) + .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) + .join('\n') +} + +RequestSigner.prototype.signedHeaders = function() { + return Object.keys(this.request.headers) + .map(function(key) { return key.toLowerCase() }) + .sort() + .join(';') +} + +RequestSigner.prototype.credentialString = function() { + return [ + this.getDate(), + this.region, + this.service, + 'aws4_request', + ].join('/') +} + +RequestSigner.prototype.defaultCredentials = function() { + var env = process.env + return { + accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, + secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, + sessionToken: env.AWS_SESSION_TOKEN, + } +} + +RequestSigner.prototype.parsePath = function() { + var path = this.request.path || '/', + queryIx = path.indexOf('?'), + query = null + + if (queryIx >= 0) { + query = querystring.parse(path.slice(queryIx + 1)) + path = path.slice(0, queryIx) + } + + // S3 doesn't always encode characters > 127 correctly and + // all services don't encode characters > 255 correctly + // So if there are non-reserved chars (and it's not already all % encoded), just encode them all + if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) { + path = path.split('/').map(function(piece) { + return encodeURIComponent(decodeURIComponent(piece)) + }).join('/') + } + + this.parsedPath = { + path: path, + query: query, + } +} + +RequestSigner.prototype.formatPath = function() { + var path = this.parsedPath.path, + query = this.parsedPath.query + + if (!query) return path + + // Services don't support empty query string keys + if (query[''] != null) delete query[''] + + return path + '?' + encodeRfc3986(querystring.stringify(query)) +} + +aws4.RequestSigner = RequestSigner + +aws4.sign = function(request, credentials) { + return new RequestSigner(request, credentials).sign() +} diff --git a/node_modules/aws4/lru.js b/node_modules/aws4/lru.js new file mode 100644 index 0000000..333f66a --- /dev/null +++ b/node_modules/aws4/lru.js @@ -0,0 +1,96 @@ +module.exports = function(size) { + return new LruCache(size) +} + +function LruCache(size) { + this.capacity = size | 0 + this.map = Object.create(null) + this.list = new DoublyLinkedList() +} + +LruCache.prototype.get = function(key) { + var node = this.map[key] + if (node == null) return undefined + this.used(node) + return node.val +} + +LruCache.prototype.set = function(key, val) { + var node = this.map[key] + if (node != null) { + node.val = val + } else { + if (!this.capacity) this.prune() + if (!this.capacity) return false + node = new DoublyLinkedNode(key, val) + this.map[key] = node + this.capacity-- + } + this.used(node) + return true +} + +LruCache.prototype.used = function(node) { + this.list.moveToFront(node) +} + +LruCache.prototype.prune = function() { + var node = this.list.pop() + if (node != null) { + delete this.map[node.key] + this.capacity++ + } +} + + +function DoublyLinkedList() { + this.firstNode = null + this.lastNode = null +} + +DoublyLinkedList.prototype.moveToFront = function(node) { + if (this.firstNode == node) return + + this.remove(node) + + if (this.firstNode == null) { + this.firstNode = node + this.lastNode = node + node.prev = null + node.next = null + } else { + node.prev = null + node.next = this.firstNode + node.next.prev = node + this.firstNode = node + } +} + +DoublyLinkedList.prototype.pop = function() { + var lastNode = this.lastNode + if (lastNode != null) { + this.remove(lastNode) + } + return lastNode +} + +DoublyLinkedList.prototype.remove = function(node) { + if (this.firstNode == node) { + this.firstNode = node.next + } else if (node.prev != null) { + node.prev.next = node.next + } + if (this.lastNode == node) { + this.lastNode = node.prev + } else if (node.next != null) { + node.next.prev = node.prev + } +} + + +function DoublyLinkedNode(key, val) { + this.key = key + this.val = val + this.prev = null + this.next = null +} diff --git a/node_modules/aws4/package.json b/node_modules/aws4/package.json new file mode 100644 index 0000000..e0f7400 --- /dev/null +++ b/node_modules/aws4/package.json @@ -0,0 +1,104 @@ +{ + "_from": "aws4@^1.6.0", + "_id": "aws4@1.7.0", + "_inBundle": false, + "_integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==", + "_location": "/aws4", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aws4@^1.6.0", + "name": "aws4", + "escapedName": "aws4", + "rawSpec": "^1.6.0", + "saveSpec": null, + "fetchSpec": "^1.6.0" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", + "_shasum": "d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289", + "_spec": "aws4@^1.6.0", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/request", + "author": { + "name": "Michael Hart", + "email": "michael.hart.au@gmail.com", + "url": "http://github.com/mhart" + }, + "bugs": { + "url": "https://github.com/mhart/aws4/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Signs and prepares requests using AWS Signature Version 4", + "devDependencies": { + "mocha": "^2.4.5", + "should": "^8.2.2" + }, + "homepage": "https://github.com/mhart/aws4#readme", + "keywords": [ + "amazon", + "aws", + "signature", + "s3", + "ec2", + "autoscaling", + "cloudformation", + "elasticloadbalancing", + "elb", + "elasticbeanstalk", + "cloudsearch", + "dynamodb", + "kinesis", + "lambda", + "glacier", + "sqs", + "sns", + "iam", + "sts", + "ses", + "swf", + "storagegateway", + "datapipeline", + "directconnect", + "redshift", + "opsworks", + "rds", + "monitoring", + "cloudtrail", + "cloudfront", + "codedeploy", + "elasticache", + "elasticmapreduce", + "elastictranscoder", + "emr", + "cloudwatch", + "mobileanalytics", + "cognitoidentity", + "cognitosync", + "cognito", + "containerservice", + "ecs", + "appstream", + "keymanagementservice", + "kms", + "config", + "cloudhsm", + "route53", + "route53domains", + "logs" + ], + "license": "MIT", + "main": "aws4.js", + "name": "aws4", + "repository": { + "type": "git", + "url": "git+https://github.com/mhart/aws4.git" + }, + "scripts": { + "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list" + }, + "version": "1.7.0" +} diff --git a/node_modules/bcrypt-pbkdf/README.md b/node_modules/bcrypt-pbkdf/README.md new file mode 100644 index 0000000..1201809 --- /dev/null +++ b/node_modules/bcrypt-pbkdf/README.md @@ -0,0 +1,39 @@ +Port of the OpenBSD `bcrypt_pbkdf` function to pure Javascript. `npm`-ified +version of [Devi Mandiri's port] +(https://github.com/devi/tmp/blob/master/js/bcrypt_pbkdf.js), +with some minor performance improvements. The code is copied verbatim (and +un-styled) from Devi's work. + +This product includes software developed by Niels Provos. + +## API + +### `bcrypt_pbkdf.pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds)` + +Derive a cryptographic key of arbitrary length from a given password and salt, +using the OpenBSD `bcrypt_pbkdf` function. This is a combination of Blowfish and +SHA-512. + +See [this article](http://www.tedunangst.com/flak/post/bcrypt-pbkdf) for +further information. + +Parameters: + + * `pass`, a Uint8Array of length `passlen` + * `passlen`, an integer Number + * `salt`, a Uint8Array of length `saltlen` + * `saltlen`, an integer Number + * `key`, a Uint8Array of length `keylen`, will be filled with output + * `keylen`, an integer Number + * `rounds`, an integer Number, number of rounds of the PBKDF to run + +### `bcrypt_pbkdf.hash(sha2pass, sha2salt, out)` + +Calculate a Blowfish hash, given SHA2-512 output of a password and salt. Used as +part of the inner round function in the PBKDF. + +Parameters: + + * `sha2pass`, a Uint8Array of length 64 + * `sha2salt`, a Uint8Array of length 64 + * `out`, a Uint8Array of length 32, will be filled with output diff --git a/node_modules/bcrypt-pbkdf/index.js b/node_modules/bcrypt-pbkdf/index.js new file mode 100644 index 0000000..b1b5ad4 --- /dev/null +++ b/node_modules/bcrypt-pbkdf/index.js @@ -0,0 +1,556 @@ +'use strict'; + +var crypto_hash_sha512 = require('tweetnacl').lowlevel.crypto_hash; + +/* + * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a + * result, it retains the original copyright and license. The two files are + * under slightly different (but compatible) licenses, and are here combined in + * one file. + * + * Credit for the actual porting work goes to: + * Devi Mandiri + */ + +/* + * The Blowfish portions are under the following license: + * + * Blowfish block cipher for OpenBSD + * Copyright 1997 Niels Provos + * All rights reserved. + * + * Implementation advice by David Mazieres . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * The bcrypt_pbkdf portions are under the following license: + * + * Copyright (c) 2013 Ted Unangst + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Performance improvements (Javascript-specific): + * + * Copyright 2016, Joyent Inc + * Author: Alex Wilson + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +// Ported from OpenBSD bcrypt_pbkdf.c v1.9 + +var BLF_J = 0; + +var Blowfish = function() { + this.S = [ + new Uint32Array([ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]), + new Uint32Array([ + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]), + new Uint32Array([ + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]), + new Uint32Array([ + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6]) + ]; + this.P = new Uint32Array([ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b]); +}; + +function F(S, x8, i) { + return (((S[0][x8[i+3]] + + S[1][x8[i+2]]) ^ + S[2][x8[i+1]]) + + S[3][x8[i]]); +}; + +Blowfish.prototype.encipher = function(x, x8) { + if (x8 === undefined) { + x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + } + x[0] ^= this.P[0]; + for (var i = 1; i < 16; i += 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i+1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[17]; + x[1] = t; +}; + +Blowfish.prototype.decipher = function(x) { + var x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + x[0] ^= this.P[17]; + for (var i = 16; i > 0; i -= 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i-1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[0]; + x[1] = t; +}; + +function stream2word(data, databytes){ + var i, temp = 0; + for (i = 0; i < 4; i++, BLF_J++) { + if (BLF_J >= databytes) BLF_J = 0; + temp = (temp << 8) | data[BLF_J]; + } + return temp; +}; + +Blowfish.prototype.expand0state = function(key, keybytes) { + var d = new Uint32Array(2), i, k; + var d8 = new Uint8Array(d.buffer); + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + BLF_J = 0; + + for (i = 0; i < 18; i += 2) { + this.encipher(d, d8); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + this.encipher(d, d8); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } +}; + +Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) { + var d = new Uint32Array(2), i, k; + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + + for (i = 0, BLF_J = 0; i < 18; i += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } + BLF_J = 0; +}; + +Blowfish.prototype.enc = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.encipher(data.subarray(i*2)); + } +}; + +Blowfish.prototype.dec = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.decipher(data.subarray(i*2)); + } +}; + +var BCRYPT_BLOCKS = 8, + BCRYPT_HASHSIZE = 32; + +function bcrypt_hash(sha2pass, sha2salt, out) { + var state = new Blowfish(), + cdata = new Uint32Array(BCRYPT_BLOCKS), i, + ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105, + 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109, + 105,116,101]); //"OxychromaticBlowfishSwatDynamite" + + state.expandstate(sha2salt, 64, sha2pass, 64); + for (i = 0; i < 64; i++) { + state.expand0state(sha2salt, 64); + state.expand0state(sha2pass, 64); + } + + for (i = 0; i < BCRYPT_BLOCKS; i++) + cdata[i] = stream2word(ciphertext, ciphertext.byteLength); + for (i = 0; i < 64; i++) + state.enc(cdata, cdata.byteLength / 8); + + for (i = 0; i < BCRYPT_BLOCKS; i++) { + out[4*i+3] = cdata[i] >>> 24; + out[4*i+2] = cdata[i] >>> 16; + out[4*i+1] = cdata[i] >>> 8; + out[4*i+0] = cdata[i]; + } +}; + +function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) { + var sha2pass = new Uint8Array(64), + sha2salt = new Uint8Array(64), + out = new Uint8Array(BCRYPT_HASHSIZE), + tmpout = new Uint8Array(BCRYPT_HASHSIZE), + countsalt = new Uint8Array(saltlen+4), + i, j, amt, stride, dest, count, + origkeylen = keylen; + + if (rounds < 1) + return -1; + if (passlen === 0 || saltlen === 0 || keylen === 0 || + keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20)) + return -1; + + stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength); + amt = Math.floor((keylen + stride - 1) / stride); + + for (i = 0; i < saltlen; i++) + countsalt[i] = salt[i]; + + crypto_hash_sha512(sha2pass, pass, passlen); + + for (count = 1; keylen > 0; count++) { + countsalt[saltlen+0] = count >>> 24; + countsalt[saltlen+1] = count >>> 16; + countsalt[saltlen+2] = count >>> 8; + countsalt[saltlen+3] = count; + + crypto_hash_sha512(sha2salt, countsalt, saltlen + 4); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (i = out.byteLength; i--;) + out[i] = tmpout[i]; + + for (i = 1; i < rounds; i++) { + crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (j = 0; j < out.byteLength; j++) + out[j] ^= tmpout[j]; + } + + amt = Math.min(amt, keylen); + for (i = 0; i < amt; i++) { + dest = i * stride + (count - 1); + if (dest >= origkeylen) + break; + key[dest] = out[i]; + } + keylen -= i; + } + + return 0; +}; + +module.exports = { + BLOCKS: BCRYPT_BLOCKS, + HASHSIZE: BCRYPT_HASHSIZE, + hash: bcrypt_hash, + pbkdf: bcrypt_pbkdf +}; diff --git a/node_modules/bcrypt-pbkdf/package.json b/node_modules/bcrypt-pbkdf/package.json new file mode 100644 index 0000000..38ed4e1 --- /dev/null +++ b/node_modules/bcrypt-pbkdf/package.json @@ -0,0 +1,36 @@ +{ + "_from": "bcrypt-pbkdf@^1.0.0", + "_id": "bcrypt-pbkdf@1.0.1", + "_inBundle": false, + "_integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "_location": "/bcrypt-pbkdf", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "bcrypt-pbkdf@^1.0.0", + "name": "bcrypt-pbkdf", + "escapedName": "bcrypt-pbkdf", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/sshpk" + ], + "_resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "_shasum": "63bc5dcb61331b92bc05fd528953c33462a06f8d", + "_spec": "bcrypt-pbkdf@^1.0.0", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/sshpk", + "bundleDependencies": false, + "dependencies": { + "tweetnacl": "^0.14.3" + }, + "deprecated": false, + "description": "Port of the OpenBSD bcrypt_pbkdf function to pure JS", + "devDependencies": {}, + "license": "BSD-3-Clause", + "main": "index.js", + "name": "bcrypt-pbkdf", + "version": "1.0.1" +} diff --git a/node_modules/boom/LICENSE b/node_modules/boom/LICENSE new file mode 100755 index 0000000..94b91cb --- /dev/null +++ b/node_modules/boom/LICENSE @@ -0,0 +1,29 @@ +Copyright (c) 2012-2017, Project contributors. +Copyright (c) 2012-2014, Walmart. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * The names of any contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + * * * + +The complete list of contributors can be found at: https://github.com/hapijs/boom/graphs/contributors diff --git a/node_modules/boom/README.md b/node_modules/boom/README.md new file mode 100755 index 0000000..6452491 --- /dev/null +++ b/node_modules/boom/README.md @@ -0,0 +1,760 @@ +![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png) + +HTTP-friendly error objects + +[![Build Status](https://secure.travis-ci.org/hapijs/boom.svg)](http://travis-ci.org/hapijs/boom) +[![Current Version](https://img.shields.io/npm/v/boom.svg)](https://www.npmjs.com/package/boom) + +Lead Maintainer: [Adam Bretz](https://github.com/arb) + + + +- [Boom](#boom) + - [Helper Methods](#helper-methods) + - [`wrap(error, [statusCode], [message])`](#wraperror-statuscode-message) + - [`create(statusCode, [message], [data])`](#createstatuscode-message-data) + - [HTTP 4xx Errors](#http-4xx-errors) + - [`Boom.badRequest([message], [data])`](#boombadrequestmessage-data) + - [`Boom.unauthorized([message], [scheme], [attributes])`](#boomunauthorizedmessage-scheme-attributes) + - [`Boom.paymentRequired([message], [data])`](#boompaymentrequiredmessage-data) + - [`Boom.forbidden([message], [data])`](#boomforbiddenmessage-data) + - [`Boom.notFound([message], [data])`](#boomnotfoundmessage-data) + - [`Boom.methodNotAllowed([message], [data], [allow])`](#boommethodnotallowedmessage-data-allow) + - [`Boom.notAcceptable([message], [data])`](#boomnotacceptablemessage-data) + - [`Boom.proxyAuthRequired([message], [data])`](#boomproxyauthrequiredmessage-data) + - [`Boom.clientTimeout([message], [data])`](#boomclienttimeoutmessage-data) + - [`Boom.conflict([message], [data])`](#boomconflictmessage-data) + - [`Boom.resourceGone([message], [data])`](#boomresourcegonemessage-data) + - [`Boom.lengthRequired([message], [data])`](#boomlengthrequiredmessage-data) + - [`Boom.preconditionFailed([message], [data])`](#boompreconditionfailedmessage-data) + - [`Boom.entityTooLarge([message], [data])`](#boomentitytoolargemessage-data) + - [`Boom.uriTooLong([message], [data])`](#boomuritoolongmessage-data) + - [`Boom.unsupportedMediaType([message], [data])`](#boomunsupportedmediatypemessage-data) + - [`Boom.rangeNotSatisfiable([message], [data])`](#boomrangenotsatisfiablemessage-data) + - [`Boom.expectationFailed([message], [data])`](#boomexpectationfailedmessage-data) + - [`Boom.teapot([message], [data])`](#boomteapotmessage-data) + - [`Boom.badData([message], [data])`](#boombaddatamessage-data) + - [`Boom.locked([message], [data])`](#boomlockedmessage-data) + - [`Boom.preconditionRequired([message], [data])`](#boompreconditionrequiredmessage-data) + - [`Boom.tooManyRequests([message], [data])`](#boomtoomanyrequestsmessage-data) + - [`Boom.illegal([message], [data])`](#boomillegalmessage-data) + - [HTTP 5xx Errors](#http-5xx-errors) + - [`Boom.badImplementation([message], [data])` - (*alias: `internal`*)](#boombadimplementationmessage-data---alias-internal) + - [`Boom.notImplemented([message], [data])`](#boomnotimplementedmessage-data) + - [`Boom.badGateway([message], [data])`](#boombadgatewaymessage-data) + - [`Boom.serverUnavailable([message], [data])`](#boomserverunavailablemessage-data) + - [`Boom.gatewayTimeout([message], [data])`](#boomgatewaytimeoutmessage-data) + - [F.A.Q.](#faq) + + + +# Boom + +**boom** provides a set of utilities for returning HTTP errors. Each utility returns a `Boom` error response +object (instance of `Error`) which includes the following properties: +- `isBoom` - if `true`, indicates this is a `Boom` object instance. +- `isServer` - convenience bool indicating status code >= 500. +- `message` - the error message. +- `output` - the formatted response. Can be directly manipulated after object construction to return a custom + error response. Allowed root keys: + - `statusCode` - the HTTP status code (typically 4xx or 5xx). + - `headers` - an object containing any HTTP headers where each key is a header name and value is the header content. + - `payload` - the formatted object used as the response payload (stringified). Can be directly manipulated but any + changes will be lost + if `reformat()` is called. Any content allowed and by default includes the following content: + - `statusCode` - the HTTP status code, derived from `error.output.statusCode`. + - `error` - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from `statusCode`. + - `message` - the error message derived from `error.message`. +- inherited `Error` properties. + +The `Boom` object also supports the following method: +- `reformat()` - rebuilds `error.output` using the other object properties. + +## Helper Methods + +### `wrap(error, [statusCode], [message])` + +Decorates an error with the **boom** properties where: +- `error` - the error object to wrap. If `error` is already a **boom** object, returns back the same object. +- `statusCode` - optional HTTP status code. Defaults to `500`. +- `message` - optional message string. If the error already has a message, it adds the message as a prefix. + Defaults to no message. + +```js +var error = new Error('Unexpected input'); +Boom.wrap(error, 400); +``` + +### `create(statusCode, [message], [data])` + +Generates an `Error` object with the **boom** decorations where: +- `statusCode` - an HTTP error code number. Must be greater or equal 400. +- `message` - optional message string. +- `data` - additional error data set to `error.data` property. + +```js +var error = Boom.create(400, 'Bad request', { timestamp: Date.now() }); +``` + +## HTTP 4xx Errors + +### `Boom.badRequest([message], [data])` + +Returns a 400 Bad Request error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badRequest('invalid query'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 400, + "error": "Bad Request", + "message": "invalid query" +} +``` + +### `Boom.unauthorized([message], [scheme], [attributes])` + +Returns a 401 Unauthorized error where: +- `message` - optional message. +- `scheme` can be one of the following: + - an authentication scheme name + - an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header. +- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used + when `scheme` is a string, otherwise it is ignored. Every key/value pair will be included in the + 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the `attributes` key. Alternatively value can be a string which is use to set the value of the scheme, for example setting the token value for negotiate header. If string is used message parameter must be null. + `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as + the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header + will not be present and `isMissing` will be true on the error object. + +If either `scheme` or `attributes` are set, the resultant `Boom` object will have the 'WWW-Authenticate' header set for the response. + +```js +Boom.unauthorized('invalid password'); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password" +}, +"headers" {} +``` + +```js +Boom.unauthorized('invalid password', 'sample'); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password", + "attributes": { + "error": "invalid password" + } +}, +"headers" { + "WWW-Authenticate": "sample error=\"invalid password\"" +} +``` + +```js +Boom.unauthorized(null, 'Negotiate', 'VGhpcyBpcyBhIHRlc3QgdG9rZW4='); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "attributes": "VGhpcyBpcyBhIHRlc3QgdG9rZW4=" +}, +"headers" { + "WWW-Authenticate": "Negotiate VGhpcyBpcyBhIHRlc3QgdG9rZW4=" +} +``` + +```js +Boom.unauthorized('invalid password', 'sample', { ttl: 0, cache: null, foo: 'bar' }); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password", + "attributes": { + "error": "invalid password", + "ttl": 0, + "cache": "", + "foo": "bar" + } +}, +"headers" { + "WWW-Authenticate": "sample ttl=\"0\", cache=\"\", foo=\"bar\", error=\"invalid password\"" +} +``` + +### `Boom.paymentRequired([message], [data])` + +Returns a 402 Payment Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.paymentRequired('bandwidth used'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 402, + "error": "Payment Required", + "message": "bandwidth used" +} +``` + +### `Boom.forbidden([message], [data])` + +Returns a 403 Forbidden error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.forbidden('try again some time'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 403, + "error": "Forbidden", + "message": "try again some time" +} +``` + +### `Boom.notFound([message], [data])` + +Returns a 404 Not Found error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notFound('missing'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 404, + "error": "Not Found", + "message": "missing" +} +``` + +### `Boom.methodNotAllowed([message], [data], [allow])` + +Returns a 405 Method Not Allowed error where: +- `message` - optional message. +- `data` - optional additional error data. +- `allow` - optional string or array of strings (to be combined and separated by ', ') which is set to the 'Allow' header. + +```js +Boom.methodNotAllowed('that method is not allowed'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 405, + "error": "Method Not Allowed", + "message": "that method is not allowed" +} +``` + +### `Boom.notAcceptable([message], [data])` + +Returns a 406 Not Acceptable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notAcceptable('unacceptable'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 406, + "error": "Not Acceptable", + "message": "unacceptable" +} +``` + +### `Boom.proxyAuthRequired([message], [data])` + +Returns a 407 Proxy Authentication Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.proxyAuthRequired('auth missing'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 407, + "error": "Proxy Authentication Required", + "message": "auth missing" +} +``` + +### `Boom.clientTimeout([message], [data])` + +Returns a 408 Request Time-out error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.clientTimeout('timed out'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 408, + "error": "Request Time-out", + "message": "timed out" +} +``` + +### `Boom.conflict([message], [data])` + +Returns a 409 Conflict error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.conflict('there was a conflict'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 409, + "error": "Conflict", + "message": "there was a conflict" +} +``` + +### `Boom.resourceGone([message], [data])` + +Returns a 410 Gone error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.resourceGone('it is gone'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 410, + "error": "Gone", + "message": "it is gone" +} +``` + +### `Boom.lengthRequired([message], [data])` + +Returns a 411 Length Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.lengthRequired('length needed'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 411, + "error": "Length Required", + "message": "length needed" +} +``` + +### `Boom.preconditionFailed([message], [data])` + +Returns a 412 Precondition Failed error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.preconditionFailed(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 412, + "error": "Precondition Failed" +} +``` + +### `Boom.entityTooLarge([message], [data])` + +Returns a 413 Request Entity Too Large error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.entityTooLarge('too big'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 413, + "error": "Request Entity Too Large", + "message": "too big" +} +``` + +### `Boom.uriTooLong([message], [data])` + +Returns a 414 Request-URI Too Large error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.uriTooLong('uri is too long'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 414, + "error": "Request-URI Too Large", + "message": "uri is too long" +} +``` + +### `Boom.unsupportedMediaType([message], [data])` + +Returns a 415 Unsupported Media Type error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.unsupportedMediaType('that media is not supported'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 415, + "error": "Unsupported Media Type", + "message": "that media is not supported" +} +``` + +### `Boom.rangeNotSatisfiable([message], [data])` + +Returns a 416 Requested Range Not Satisfiable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.rangeNotSatisfiable(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 416, + "error": "Requested Range Not Satisfiable" +} +``` + +### `Boom.expectationFailed([message], [data])` + +Returns a 417 Expectation Failed error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.expectationFailed('expected this to work'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 417, + "error": "Expectation Failed", + "message": "expected this to work" +} +``` + +### `Boom.teapot([message], [data])` + +Returns a 418 I'm a Teapot error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.teapot('sorry, no coffee...'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 418, + "error": "I'm a Teapot", + "message": "Sorry, no coffee..." +} +``` + +### `Boom.badData([message], [data])` + +Returns a 422 Unprocessable Entity error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badData('your data is bad and you should feel bad'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 422, + "error": "Unprocessable Entity", + "message": "your data is bad and you should feel bad" +} +``` + +### `Boom.locked([message], [data])` + +Returns a 423 Locked error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.locked('this resource has been locked'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 423, + "error": "Locked", + "message": "this resource has been locked" +} +``` + +### `Boom.preconditionRequired([message], [data])` + +Returns a 428 Precondition Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.preconditionRequired('you must supply an If-Match header'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 428, + "error": "Precondition Required", + "message": "you must supply an If-Match header" +} +``` + +### `Boom.tooManyRequests([message], [data])` + +Returns a 429 Too Many Requests error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.tooManyRequests('you have exceeded your request limit'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 429, + "error": "Too Many Requests", + "message": "you have exceeded your request limit" +} +``` + +### `Boom.illegal([message], [data])` + +Returns a 451 Unavailable For Legal Reasons error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.illegal('you are not permitted to view this resource for legal reasons'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 451, + "error": "Unavailable For Legal Reasons", + "message": "you are not permitted to view this resource for legal reasons" +} +``` + +## HTTP 5xx Errors + +All 500 errors hide your message from the end user. Your message is recorded in the server log. + +### `Boom.badImplementation([message], [data])` - (*alias: `internal`*) + +Returns a 500 Internal Server Error error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badImplementation('terrible implementation'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 500, + "error": "Internal Server Error", + "message": "An internal server error occurred" +} +``` + +### `Boom.notImplemented([message], [data])` + +Returns a 501 Not Implemented error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notImplemented('method not implemented'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 501, + "error": "Not Implemented", + "message": "method not implemented" +} +``` + +### `Boom.badGateway([message], [data])` + +Returns a 502 Bad Gateway error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badGateway('that is a bad gateway'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 502, + "error": "Bad Gateway", + "message": "that is a bad gateway" +} +``` + +### `Boom.serverUnavailable([message], [data])` + +Returns a 503 Service Unavailable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.serverUnavailable('unavailable'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 503, + "error": "Service Unavailable", + "message": "unavailable" +} +``` + +### `Boom.gatewayTimeout([message], [data])` + +Returns a 504 Gateway Time-out error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.gatewayTimeout(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 504, + "error": "Gateway Time-out" +} +``` + +## F.A.Q. + +**Q** How do I include extra information in my responses? `output.payload` is missing `data`, what gives? + +**A** There is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the ["Error transformation"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation. + +--- diff --git a/node_modules/boom/lib/index.js b/node_modules/boom/lib/index.js new file mode 100755 index 0000000..17ed027 --- /dev/null +++ b/node_modules/boom/lib/index.js @@ -0,0 +1,433 @@ +'use strict'; + +// Load modules + +const Hoek = require('hoek'); + + +// Declare internals + +const internals = { + STATUS_CODES: Object.setPrototypeOf({ + '100': 'Continue', + '101': 'Switching Protocols', + '102': 'Processing', + '200': 'OK', + '201': 'Created', + '202': 'Accepted', + '203': 'Non-Authoritative Information', + '204': 'No Content', + '205': 'Reset Content', + '206': 'Partial Content', + '207': 'Multi-Status', + '300': 'Multiple Choices', + '301': 'Moved Permanently', + '302': 'Moved Temporarily', + '303': 'See Other', + '304': 'Not Modified', + '305': 'Use Proxy', + '307': 'Temporary Redirect', + '400': 'Bad Request', + '401': 'Unauthorized', + '402': 'Payment Required', + '403': 'Forbidden', + '404': 'Not Found', + '405': 'Method Not Allowed', + '406': 'Not Acceptable', + '407': 'Proxy Authentication Required', + '408': 'Request Time-out', + '409': 'Conflict', + '410': 'Gone', + '411': 'Length Required', + '412': 'Precondition Failed', + '413': 'Request Entity Too Large', + '414': 'Request-URI Too Large', + '415': 'Unsupported Media Type', + '416': 'Requested Range Not Satisfiable', + '417': 'Expectation Failed', + '418': 'I\'m a teapot', + '422': 'Unprocessable Entity', + '423': 'Locked', + '424': 'Failed Dependency', + '425': 'Unordered Collection', + '426': 'Upgrade Required', + '428': 'Precondition Required', + '429': 'Too Many Requests', + '431': 'Request Header Fields Too Large', + '451': 'Unavailable For Legal Reasons', + '500': 'Internal Server Error', + '501': 'Not Implemented', + '502': 'Bad Gateway', + '503': 'Service Unavailable', + '504': 'Gateway Time-out', + '505': 'HTTP Version Not Supported', + '506': 'Variant Also Negotiates', + '507': 'Insufficient Storage', + '509': 'Bandwidth Limit Exceeded', + '510': 'Not Extended', + '511': 'Network Authentication Required' + }, null) +}; + + +exports.wrap = function (error, statusCode, message) { + + Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object'); + Hoek.assert(!error.isBoom || (!statusCode && !message), 'Cannot provide statusCode or message with boom error'); + + return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message)); +}; + + +exports.create = function (statusCode, message, data) { + + return internals.create(statusCode, message, data, exports.create); +}; + + +internals.create = function (statusCode, message, data, ctor) { + + if (message instanceof Error) { + if (data) { + message.data = data; + } + return exports.wrap(message, statusCode); + } + + const error = new Error(message ? message : undefined); // Avoids settings null message + Error.captureStackTrace(error, ctor); // Filter the stack to our external API + error.data = data || null; + internals.initialize(error, statusCode); + return error; +}; + + +internals.initialize = function (error, statusCode, message) { + + const numberCode = parseInt(statusCode, 10); + Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode); + + error.isBoom = true; + error.isServer = numberCode >= 500; + + if (!error.hasOwnProperty('data')) { + error.data = null; + } + + error.output = { + statusCode: numberCode, + payload: {}, + headers: {} + }; + + error.reformat = internals.reformat; + error.reformat(); + + if (!message && + !error.message) { + + message = error.output.payload.error; + } + + if (message) { + error.message = (message + (error.message ? ': ' + error.message : '')); + } + + return error; +}; + + +internals.reformat = function () { + + this.output.payload.statusCode = this.output.statusCode; + this.output.payload.error = internals.STATUS_CODES[this.output.statusCode] || 'Unknown'; + + if (this.output.statusCode === 500) { + this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user + } + else if (this.message) { + this.output.payload.message = this.message; + } +}; + + +// 4xx Client Errors + +exports.badRequest = function (message, data) { + + return internals.create(400, message, data, exports.badRequest); +}; + + +exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[]) + + const err = internals.create(401, message, undefined, exports.unauthorized); + + if (!scheme) { + return err; + } + + let wwwAuthenticate = ''; + + if (typeof scheme === 'string') { + + // function (message, scheme, attributes) + + wwwAuthenticate = scheme; + + if (attributes || message) { + err.output.payload.attributes = {}; + } + + if (attributes) { + if (typeof attributes === 'string') { + wwwAuthenticate = wwwAuthenticate + ' ' + Hoek.escapeHeaderAttribute(attributes); + err.output.payload.attributes = attributes; + } + else { + const names = Object.keys(attributes); + for (let i = 0; i < names.length; ++i) { + const name = names[i]; + if (i) { + wwwAuthenticate = wwwAuthenticate + ','; + } + + let value = attributes[name]; + if (value === null || + value === undefined) { // Value can be zero + + value = ''; + } + wwwAuthenticate = wwwAuthenticate + ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; + err.output.payload.attributes[name] = value; + } + } + } + + + if (message) { + if (attributes) { + wwwAuthenticate = wwwAuthenticate + ','; + } + wwwAuthenticate = wwwAuthenticate + ' error="' + Hoek.escapeHeaderAttribute(message) + '"'; + err.output.payload.attributes.error = message; + } + else { + err.isMissing = true; + } + } + else { + + // function (message, wwwAuthenticate[]) + + const wwwArray = scheme; + for (let i = 0; i < wwwArray.length; ++i) { + if (i) { + wwwAuthenticate = wwwAuthenticate + ', '; + } + + wwwAuthenticate = wwwAuthenticate + wwwArray[i]; + } + } + + err.output.headers['WWW-Authenticate'] = wwwAuthenticate; + + return err; +}; + + +exports.paymentRequired = function (message, data) { + + return internals.create(402, message, data, exports.paymentRequired); +}; + + +exports.forbidden = function (message, data) { + + return internals.create(403, message, data, exports.forbidden); +}; + + +exports.notFound = function (message, data) { + + return internals.create(404, message, data, exports.notFound); +}; + + +exports.methodNotAllowed = function (message, data, allow) { + + const err = internals.create(405, message, data, exports.methodNotAllowed); + + if (typeof allow === 'string') { + allow = [allow]; + } + + if (Array.isArray(allow)) { + err.output.headers.Allow = allow.join(', '); + } + + return err; +}; + + +exports.notAcceptable = function (message, data) { + + return internals.create(406, message, data, exports.notAcceptable); +}; + + +exports.proxyAuthRequired = function (message, data) { + + return internals.create(407, message, data, exports.proxyAuthRequired); +}; + + +exports.clientTimeout = function (message, data) { + + return internals.create(408, message, data, exports.clientTimeout); +}; + + +exports.conflict = function (message, data) { + + return internals.create(409, message, data, exports.conflict); +}; + + +exports.resourceGone = function (message, data) { + + return internals.create(410, message, data, exports.resourceGone); +}; + + +exports.lengthRequired = function (message, data) { + + return internals.create(411, message, data, exports.lengthRequired); +}; + + +exports.preconditionFailed = function (message, data) { + + return internals.create(412, message, data, exports.preconditionFailed); +}; + + +exports.entityTooLarge = function (message, data) { + + return internals.create(413, message, data, exports.entityTooLarge); +}; + + +exports.uriTooLong = function (message, data) { + + return internals.create(414, message, data, exports.uriTooLong); +}; + + +exports.unsupportedMediaType = function (message, data) { + + return internals.create(415, message, data, exports.unsupportedMediaType); +}; + + +exports.rangeNotSatisfiable = function (message, data) { + + return internals.create(416, message, data, exports.rangeNotSatisfiable); +}; + + +exports.expectationFailed = function (message, data) { + + return internals.create(417, message, data, exports.expectationFailed); +}; + + +exports.teapot = function (message, data) { + + return internals.create(418, message, data, exports.teapot); +}; + + +exports.badData = function (message, data) { + + return internals.create(422, message, data, exports.badData); +}; + + +exports.locked = function (message, data) { + + return internals.create(423, message, data, exports.locked); +}; + + +exports.preconditionRequired = function (message, data) { + + return internals.create(428, message, data, exports.preconditionRequired); +}; + + +exports.tooManyRequests = function (message, data) { + + return internals.create(429, message, data, exports.tooManyRequests); +}; + + +exports.illegal = function (message, data) { + + return internals.create(451, message, data, exports.illegal); +}; + + +// 5xx Server Errors + +exports.internal = function (message, data, statusCode) { + + return internals.serverError(message, data, statusCode, exports.internal); +}; + + +internals.serverError = function (message, data, statusCode, ctor) { + + let error; + if (data instanceof Error) { + error = exports.wrap(data, statusCode, message); + } + else { + error = internals.create(statusCode || 500, message, undefined, ctor); + error.data = data; + } + + return error; +}; + + +exports.notImplemented = function (message, data) { + + return internals.serverError(message, data, 501, exports.notImplemented); +}; + + +exports.badGateway = function (message, data) { + + return internals.serverError(message, data, 502, exports.badGateway); +}; + + +exports.serverUnavailable = function (message, data) { + + return internals.serverError(message, data, 503, exports.serverUnavailable); +}; + + +exports.gatewayTimeout = function (message, data) { + + return internals.serverError(message, data, 504, exports.gatewayTimeout); +}; + + +exports.badImplementation = function (message, data) { + + const err = internals.serverError(message, data, 500, exports.badImplementation); + err.isDeveloperError = true; + return err; +}; diff --git a/node_modules/boom/package.json b/node_modules/boom/package.json new file mode 100644 index 0000000..1636b57 --- /dev/null +++ b/node_modules/boom/package.json @@ -0,0 +1,61 @@ +{ + "_from": "boom@4.x.x", + "_id": "boom@4.3.1", + "_inBundle": false, + "_integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "_location": "/boom", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "boom@4.x.x", + "name": "boom", + "escapedName": "boom", + "rawSpec": "4.x.x", + "saveSpec": null, + "fetchSpec": "4.x.x" + }, + "_requiredBy": [ + "/hawk" + ], + "_resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "_shasum": "4f8a3005cb4a7e3889f749030fd25b96e01d2e31", + "_spec": "boom@4.x.x", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/hawk", + "bugs": { + "url": "https://github.com/hapijs/boom/issues" + }, + "bundleDependencies": false, + "dependencies": { + "hoek": "4.x.x" + }, + "deprecated": false, + "description": "HTTP-friendly error objects", + "devDependencies": { + "code": "4.x.x", + "lab": "13.x.x", + "markdown-toc": "0.12.x" + }, + "engines": { + "node": ">=4.0.0" + }, + "homepage": "https://github.com/hapijs/boom#readme", + "keywords": [ + "error", + "http" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", + "name": "boom", + "repository": { + "type": "git", + "url": "git://github.com/hapijs/boom.git" + }, + "scripts": { + "test": "lab -a code -t 100 -L -v", + "test-cov-html": "lab -a code -r html -o coverage.html -L", + "toc": "node generate-toc.js", + "version": "npm run toc && git add README.md" + }, + "version": "4.3.1" +} diff --git a/node_modules/browser-process-hrtime/.npmignore b/node_modules/browser-process-hrtime/.npmignore new file mode 100644 index 0000000..93a9cd0 --- /dev/null +++ b/node_modules/browser-process-hrtime/.npmignore @@ -0,0 +1,35 @@ +# Created by http://www.gitignore.io + +### OSX ### +.DS_Store +.AppleDouble +.LSOverride + +# Icon must ends with two \r. +Icon + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + + +### Node ### +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results +build + +node_modules + diff --git a/node_modules/browser-process-hrtime/README.md b/node_modules/browser-process-hrtime/README.md new file mode 100644 index 0000000..acecb1c --- /dev/null +++ b/node_modules/browser-process-hrtime/README.md @@ -0,0 +1,25 @@ +# browser-process-hrtime + +Browser shim for Node.js process.hrtime(). +See [documentation at nodejs.org](http://nodejs.org/api/process.html#process_process_hrtime) + +### usage +Use hrtime independant of environment (node or browser). +It will use process.hrtime first and fallback if not present. +```js +var hrtime = require('browser-process-hrtime') +var start = hrtime() +// ... +var delta = hrtime(start) +``` + +### monkey-patching +You can monkey-patch process.hrtime for your dependency graph like this: +```js +process.hrtime = require('browser-process-hrtime') +var coolTool = require('module-that-uses-hrtime-somewhere-in-its-depths') +``` + +### note +This was originally pull-requested against [node-process](https://github.com/defunctzombie/node-process), +but they are trying to stay lean. diff --git a/node_modules/browser-process-hrtime/index.js b/node_modules/browser-process-hrtime/index.js new file mode 100644 index 0000000..7312c2c --- /dev/null +++ b/node_modules/browser-process-hrtime/index.js @@ -0,0 +1,28 @@ +module.exports = process.hrtime || hrtime + +// polyfil for window.performance.now +var performance = global.performance || {} +var performanceNow = + performance.now || + performance.mozNow || + performance.msNow || + performance.oNow || + performance.webkitNow || + function(){ return (new Date()).getTime() } + +// generate timestamp or delta +// see http://nodejs.org/api/process.html#process_process_hrtime +function hrtime(previousTimestamp){ + var clocktime = performanceNow.call(performance)*1e-3 + var seconds = Math.floor(clocktime) + var nanoseconds = Math.floor((clocktime%1)*1e9) + if (previousTimestamp) { + seconds = seconds - previousTimestamp[0] + nanoseconds = nanoseconds - previousTimestamp[1] + if (nanoseconds<0) { + seconds-- + nanoseconds += 1e9 + } + } + return [seconds,nanoseconds] +} \ No newline at end of file diff --git a/node_modules/browser-process-hrtime/package.json b/node_modules/browser-process-hrtime/package.json new file mode 100644 index 0000000..746f079 --- /dev/null +++ b/node_modules/browser-process-hrtime/package.json @@ -0,0 +1,46 @@ +{ + "_from": "browser-process-hrtime@^0.1.2", + "_id": "browser-process-hrtime@0.1.2", + "_inBundle": false, + "_integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44=", + "_location": "/browser-process-hrtime", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "browser-process-hrtime@^0.1.2", + "name": "browser-process-hrtime", + "escapedName": "browser-process-hrtime", + "rawSpec": "^0.1.2", + "saveSpec": null, + "fetchSpec": "^0.1.2" + }, + "_requiredBy": [ + "/w3c-hr-time" + ], + "_resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz", + "_shasum": "425d68a58d3447f02a04aa894187fce8af8b7b8e", + "_spec": "browser-process-hrtime@^0.1.2", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/w3c-hr-time", + "author": { + "name": "kumavis" + }, + "bugs": { + "url": "https://github.com/kumavis/browser-process-hrtime/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Shim for process.hrtime in the browser", + "homepage": "https://github.com/kumavis/browser-process-hrtime#readme", + "license": "BSD-2-Clause", + "main": "index.js", + "name": "browser-process-hrtime", + "repository": { + "type": "git", + "url": "git://github.com/kumavis/browser-process-hrtime.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "0.1.2" +} diff --git a/node_modules/caseless/LICENSE b/node_modules/caseless/LICENSE new file mode 100644 index 0000000..61789f4 --- /dev/null +++ b/node_modules/caseless/LICENSE @@ -0,0 +1,28 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/node_modules/caseless/README.md b/node_modules/caseless/README.md new file mode 100644 index 0000000..e5077a2 --- /dev/null +++ b/node_modules/caseless/README.md @@ -0,0 +1,45 @@ +## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing. + +This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set. + +## Usage + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'asdf') +c.get('a-header') === 'asdf' +``` + +## has(key) + +Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with. + +```javascript +c.has('a-header') === 'a-Header' +``` + +## set(key, value[, clobber=true]) + +Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header. + +```javascript +c.set('a-Header', 'fdas') +c.set('a-HEADER', 'more', false) +c.get('a-header') === 'fdsa,more' +``` + +## swap(key) + +Swaps the casing of a header with the new one that is passed in. + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'fdas') +c.swap('a-HEADER') +c.has('a-header') === 'a-HEADER' +headers === {'a-HEADER': 'fdas'} +``` diff --git a/node_modules/caseless/index.js b/node_modules/caseless/index.js new file mode 100644 index 0000000..b194734 --- /dev/null +++ b/node_modules/caseless/index.js @@ -0,0 +1,67 @@ +function Caseless (dict) { + this.dict = dict || {} +} +Caseless.prototype.set = function (name, value, clobber) { + if (typeof name === 'object') { + for (var i in name) { + this.set(i, name[i], value) + } + } else { + if (typeof clobber === 'undefined') clobber = true + var has = this.has(name) + + if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value + else this.dict[has || name] = value + return has + } +} +Caseless.prototype.has = function (name) { + var keys = Object.keys(this.dict) + , name = name.toLowerCase() + ; + for (var i=0;i [1, 2, 3] +}).catch(onerror); + +// errors can be try/catched +co(function *(){ + try { + yield Promise.reject(new Error('boom')); + } catch (err) { + console.error(err.message); // "boom" + } +}).catch(onerror); + +function onerror(err) { + // log any uncaught errors + // co will not throw any errors you do not handle!!! + // HANDLE ALL YOUR ERRORS!!! + console.error(err.stack); +} +``` + +## Yieldables + + The `yieldable` objects currently supported are: + + - promises + - thunks (functions) + - array (parallel execution) + - objects (parallel execution) + - generators (delegation) + - generator functions (delegation) + +Nested `yieldable` objects are supported, meaning you can nest +promises within objects within arrays, and so on! + +### Promises + +[Read more on promises!](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) + +### Thunks + +Thunks are functions that only have a single argument, a callback. +Thunk support only remains for backwards compatibility and may +be removed in future versions of `co`. + +### Arrays + +`yield`ing an array will resolve all the `yieldables` in parallel. + +```js +co(function* () { + var res = yield [ + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), + ]; + console.log(res); // => [1, 2, 3] +}).catch(onerror); +``` + +### Objects + +Just like arrays, objects resolve all `yieldable`s in parallel. + +```js +co(function* () { + var res = yield { + 1: Promise.resolve(1), + 2: Promise.resolve(2), + }; + console.log(res); // => { 1: 1, 2: 2 } +}).catch(onerror); +``` + +### Generators and Generator Functions + +Any generator or generator function you can pass into `co` +can be yielded as well. This should generally be avoided +as we should be moving towards spec-compliant `Promise`s instead. + +## API + +### co(fn*).then( val => ) + +Returns a promise that resolves a generator, generator function, +or any function that returns a generator. + +```js +co(function* () { + return yield Promise.resolve(true); +}).then(function (val) { + console.log(val); +}, function (err) { + console.error(err.stack); +}); +``` + +### var fn = co.wrap(fn*) + +Convert a generator into a regular function that returns a `Promise`. + +```js +var fn = co.wrap(function* (val) { + return yield Promise.resolve(val); +}); + +fn(true).then(function (val) { + +}); +``` + +## License + + MIT + +[npm-image]: https://img.shields.io/npm/v/co.svg?style=flat-square +[npm-url]: https://npmjs.org/package/co +[travis-image]: https://img.shields.io/travis/tj/co.svg?style=flat-square +[travis-url]: https://travis-ci.org/tj/co +[coveralls-image]: https://img.shields.io/coveralls/tj/co.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/tj/co +[downloads-image]: http://img.shields.io/npm/dm/co.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/co +[gitter-image]: https://badges.gitter.im/Join%20Chat.svg +[gitter-url]: https://gitter.im/tj/co?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge diff --git a/node_modules/co/index.js b/node_modules/co/index.js new file mode 100644 index 0000000..87ba8ba --- /dev/null +++ b/node_modules/co/index.js @@ -0,0 +1,237 @@ + +/** + * slice() reference. + */ + +var slice = Array.prototype.slice; + +/** + * Expose `co`. + */ + +module.exports = co['default'] = co.co = co; + +/** + * Wrap the given generator `fn` into a + * function that returns a promise. + * This is a separate function so that + * every `co()` call doesn't create a new, + * unnecessary closure. + * + * @param {GeneratorFunction} fn + * @return {Function} + * @api public + */ + +co.wrap = function (fn) { + createPromise.__generatorFunction__ = fn; + return createPromise; + function createPromise() { + return co.call(this, fn.apply(this, arguments)); + } +}; + +/** + * Execute the generator function or a generator + * and return a promise. + * + * @param {Function} fn + * @return {Promise} + * @api public + */ + +function co(gen) { + var ctx = this; + var args = slice.call(arguments, 1) + + // we wrap everything in a promise to avoid promise chaining, + // which leads to memory leak errors. + // see https://github.com/tj/co/issues/180 + return new Promise(function(resolve, reject) { + if (typeof gen === 'function') gen = gen.apply(ctx, args); + if (!gen || typeof gen.next !== 'function') return resolve(gen); + + onFulfilled(); + + /** + * @param {Mixed} res + * @return {Promise} + * @api private + */ + + function onFulfilled(res) { + var ret; + try { + ret = gen.next(res); + } catch (e) { + return reject(e); + } + next(ret); + } + + /** + * @param {Error} err + * @return {Promise} + * @api private + */ + + function onRejected(err) { + var ret; + try { + ret = gen.throw(err); + } catch (e) { + return reject(e); + } + next(ret); + } + + /** + * Get the next value in the generator, + * return a promise. + * + * @param {Object} ret + * @return {Promise} + * @api private + */ + + function next(ret) { + if (ret.done) return resolve(ret.value); + var value = toPromise.call(ctx, ret.value); + if (value && isPromise(value)) return value.then(onFulfilled, onRejected); + return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, ' + + 'but the following object was passed: "' + String(ret.value) + '"')); + } + }); +} + +/** + * Convert a `yield`ed value into a promise. + * + * @param {Mixed} obj + * @return {Promise} + * @api private + */ + +function toPromise(obj) { + if (!obj) return obj; + if (isPromise(obj)) return obj; + if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj); + if ('function' == typeof obj) return thunkToPromise.call(this, obj); + if (Array.isArray(obj)) return arrayToPromise.call(this, obj); + if (isObject(obj)) return objectToPromise.call(this, obj); + return obj; +} + +/** + * Convert a thunk to a promise. + * + * @param {Function} + * @return {Promise} + * @api private + */ + +function thunkToPromise(fn) { + var ctx = this; + return new Promise(function (resolve, reject) { + fn.call(ctx, function (err, res) { + if (err) return reject(err); + if (arguments.length > 2) res = slice.call(arguments, 1); + resolve(res); + }); + }); +} + +/** + * Convert an array of "yieldables" to a promise. + * Uses `Promise.all()` internally. + * + * @param {Array} obj + * @return {Promise} + * @api private + */ + +function arrayToPromise(obj) { + return Promise.all(obj.map(toPromise, this)); +} + +/** + * Convert an object of "yieldables" to a promise. + * Uses `Promise.all()` internally. + * + * @param {Object} obj + * @return {Promise} + * @api private + */ + +function objectToPromise(obj){ + var results = new obj.constructor(); + var keys = Object.keys(obj); + var promises = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var promise = toPromise.call(this, obj[key]); + if (promise && isPromise(promise)) defer(promise, key); + else results[key] = obj[key]; + } + return Promise.all(promises).then(function () { + return results; + }); + + function defer(promise, key) { + // predefine the key in the result + results[key] = undefined; + promises.push(promise.then(function (res) { + results[key] = res; + })); + } +} + +/** + * Check if `obj` is a promise. + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ + +function isPromise(obj) { + return 'function' == typeof obj.then; +} + +/** + * Check if `obj` is a generator. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ + +function isGenerator(obj) { + return 'function' == typeof obj.next && 'function' == typeof obj.throw; +} + +/** + * Check if `obj` is a generator function. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ +function isGeneratorFunction(obj) { + var constructor = obj.constructor; + if (!constructor) return false; + if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; + return isGenerator(constructor.prototype); +} + +/** + * Check for plain object. + * + * @param {Mixed} val + * @return {Boolean} + * @api private + */ + +function isObject(val) { + return Object == val.constructor; +} diff --git a/node_modules/co/package.json b/node_modules/co/package.json new file mode 100644 index 0000000..a90dc47 --- /dev/null +++ b/node_modules/co/package.json @@ -0,0 +1,66 @@ +{ + "_from": "co@^4.6.0", + "_id": "co@4.6.0", + "_inBundle": false, + "_integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "_location": "/co", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "co@^4.6.0", + "name": "co", + "escapedName": "co", + "rawSpec": "^4.6.0", + "saveSpec": null, + "fetchSpec": "^4.6.0" + }, + "_requiredBy": [ + "/ajv" + ], + "_resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "_shasum": "6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184", + "_spec": "co@^4.6.0", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/ajv", + "bugs": { + "url": "https://github.com/tj/co/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "generator async control flow goodness", + "devDependencies": { + "browserify": "^10.0.0", + "istanbul-harmony": "0", + "mocha": "^2.0.0", + "mz": "^1.0.2" + }, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/tj/co#readme", + "keywords": [ + "async", + "flow", + "generator", + "coro", + "coroutine" + ], + "license": "MIT", + "name": "co", + "repository": { + "type": "git", + "url": "git+https://github.com/tj/co.git" + }, + "scripts": { + "browserify": "browserify index.js -o ./co-browser.js -s co", + "prepublish": "npm run browserify", + "test": "mocha --harmony", + "test-cov": "node --harmony node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter dot", + "test-travis": "node --harmony node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --reporter dot" + }, + "version": "4.6.0" +} diff --git a/node_modules/combined-stream/License b/node_modules/combined-stream/License new file mode 100644 index 0000000..4804b7a --- /dev/null +++ b/node_modules/combined-stream/License @@ -0,0 +1,19 @@ +Copyright (c) 2011 Debuggable Limited + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/combined-stream/Readme.md b/node_modules/combined-stream/Readme.md new file mode 100644 index 0000000..9e367b5 --- /dev/null +++ b/node_modules/combined-stream/Readme.md @@ -0,0 +1,138 @@ +# combined-stream + +A stream that emits multiple other streams one after another. + +**NB** Currently `combined-stream` works with streams version 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatibility with `combined-stream`. + +- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module. + +- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another. + +## Installation + +``` bash +npm install combined-stream +``` + +## Usage + +Here is a simple example that shows how you can use combined-stream to combine +two files into one: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +While the example above works great, it will pause all source streams until +they are needed. If you don't want that to happen, you can set `pauseStreams` +to `false`: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create({pauseStreams: false}); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +However, what if you don't have all the source streams yet, or you don't want +to allocate the resources (file descriptors, memory, etc.) for them right away? +Well, in that case you can simply provide a callback that supplies the stream +by calling a `next()` function: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(function(next) { + next(fs.createReadStream('file1.txt')); +}); +combinedStream.append(function(next) { + next(fs.createReadStream('file2.txt')); +}); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +## API + +### CombinedStream.create([options]) + +Returns a new combined stream object. Available options are: + +* `maxDataSize` +* `pauseStreams` + +The effect of those options is described below. + +### combinedStream.pauseStreams = `true` + +Whether to apply back pressure to the underlaying streams. If set to `false`, +the underlaying streams will never be paused. If set to `true`, the +underlaying streams will be paused right after being appended, as well as when +`delayedStream.pipe()` wants to throttle. + +### combinedStream.maxDataSize = `2 * 1024 * 1024` + +The maximum amount of bytes (or characters) to buffer for all source streams. +If this value is exceeded, `combinedStream` emits an `'error'` event. + +### combinedStream.dataSize = `0` + +The amount of bytes (or characters) currently buffered by `combinedStream`. + +### combinedStream.append(stream) + +Appends the given `stream` to the combinedStream object. If `pauseStreams` is +set to `true, this stream will also be paused right away. + +`streams` can also be a function that takes one parameter called `next`. `next` +is a function that must be invoked in order to provide the `next` stream, see +example above. + +Regardless of how the `stream` is appended, combined-stream always attaches an +`'error'` listener to it, so you don't have to do that manually. + +Special case: `stream` can also be a String or Buffer. + +### combinedStream.write(data) + +You should not call this, `combinedStream` takes care of piping the appended +streams into itself for you. + +### combinedStream.resume() + +Causes `combinedStream` to start drain the streams it manages. The function is +idempotent, and also emits a `'resume'` event each time which usually goes to +the stream that is currently being drained. + +### combinedStream.pause(); + +If `combinedStream.pauseStreams` is set to `false`, this does nothing. +Otherwise a `'pause'` event is emitted, this goes to the stream that is +currently being drained, so you can use it to apply back pressure. + +### combinedStream.end(); + +Sets `combinedStream.writable` to false, emits an `'end'` event, and removes +all streams from the queue. + +### combinedStream.destroy(); + +Same as `combinedStream.end()`, except it emits a `'close'` event instead of +`'end'`. + +## License + +combined-stream is licensed under the MIT license. diff --git a/node_modules/combined-stream/lib/combined_stream.js b/node_modules/combined-stream/lib/combined_stream.js new file mode 100644 index 0000000..809b3c2 --- /dev/null +++ b/node_modules/combined-stream/lib/combined_stream.js @@ -0,0 +1,189 @@ +var util = require('util'); +var Stream = require('stream').Stream; +var DelayedStream = require('delayed-stream'); +var defer = require('./defer.js'); + +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + + this._released = false; + this._streams = []; + this._currentStream = null; +} +util.inherits(CombinedStream, Stream); + +CombinedStream.create = function(options) { + var combinedStream = new this(); + + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + + return combinedStream; +}; + +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; + +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } + + this._handleErrors(stream); + + if (this.pauseStreams) { + stream.pause(); + } + } + + this._streams.push(stream); + return this; +}; + +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; + +CombinedStream.prototype._getNext = function() { + this._currentStream = null; + var stream = this._streams.shift(); + + + if (typeof stream == 'undefined') { + this.end(); + return; + } + + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } + + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } + + defer(this._pipeNext.bind(this, stream)); + }.bind(this)); +}; + +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } + + var value = stream; + this.write(value); + this._getNext(); +}; + +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; + +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; + +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; + +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; + +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; + +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; + +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; + +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; + +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } + + self.dataSize += stream.dataSize; + }); + + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; diff --git a/node_modules/combined-stream/lib/defer.js b/node_modules/combined-stream/lib/defer.js new file mode 100644 index 0000000..b67110c --- /dev/null +++ b/node_modules/combined-stream/lib/defer.js @@ -0,0 +1,26 @@ +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} diff --git a/node_modules/combined-stream/package.json b/node_modules/combined-stream/package.json new file mode 100644 index 0000000..e70bab9 --- /dev/null +++ b/node_modules/combined-stream/package.json @@ -0,0 +1,58 @@ +{ + "_from": "combined-stream@~1.0.5", + "_id": "combined-stream@1.0.6", + "_inBundle": false, + "_integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "_location": "/combined-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "combined-stream@~1.0.5", + "name": "combined-stream", + "escapedName": "combined-stream", + "rawSpec": "~1.0.5", + "saveSpec": null, + "fetchSpec": "~1.0.5" + }, + "_requiredBy": [ + "/form-data", + "/request" + ], + "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "_shasum": "723e7df6e801ac5613113a7e445a9b69cb632818", + "_spec": "combined-stream@~1.0.5", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/request", + "author": { + "name": "Felix Geisendörfer", + "email": "felix@debuggable.com", + "url": "http://debuggable.com/" + }, + "bugs": { + "url": "https://github.com/felixge/node-combined-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "deprecated": false, + "description": "A stream that emits multiple other streams one after another.", + "devDependencies": { + "far": "~0.0.7" + }, + "engines": { + "node": ">= 0.8" + }, + "homepage": "https://github.com/felixge/node-combined-stream", + "license": "MIT", + "main": "./lib/combined_stream", + "name": "combined-stream", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-combined-stream.git" + }, + "scripts": { + "test": "node test/run.js" + }, + "version": "1.0.6" +} diff --git a/node_modules/cryptiles/.npmignore b/node_modules/cryptiles/.npmignore new file mode 100644 index 0000000..10c1307 --- /dev/null +++ b/node_modules/cryptiles/.npmignore @@ -0,0 +1,3 @@ +* +!lib/** +!.npmignore diff --git a/node_modules/cryptiles/LICENSE b/node_modules/cryptiles/LICENSE new file mode 100755 index 0000000..4028ccd --- /dev/null +++ b/node_modules/cryptiles/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2014-2017, Eran Hammer and Project contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * The names of any contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + * * * + +The complete list of contributors can be found at: https://github.com/hueniverse/cryptiles/graphs/contributors diff --git a/node_modules/cryptiles/README.md b/node_modules/cryptiles/README.md new file mode 100755 index 0000000..b3df9e6 --- /dev/null +++ b/node_modules/cryptiles/README.md @@ -0,0 +1,19 @@ +cryptiles +========= + +General purpose crypto utilities + +[![Build Status](https://secure.travis-ci.org/hapijs/cryptiles.png)](http://travis-ci.org/hapijs/cryptiles) + +Lead Maintainer - [C J Silverio](https://github.com/ceejbot) + +## Methods + +### `randomString( size)` +Returns a cryptographically strong pseudo-random data string. Takes a size argument for the length of the string. + +### `randomDigits( size)` +Returns a cryptographically strong pseudo-random data string consisting of only numerical digits (0-9). Takes a size argument for the length of the string. + +### `fixedTimeComparison( a, b)` +Compare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match). Returns `true` if the strings match, `false` if they differ. diff --git a/node_modules/cryptiles/lib/index.js b/node_modules/cryptiles/lib/index.js new file mode 100755 index 0000000..511eab6 --- /dev/null +++ b/node_modules/cryptiles/lib/index.js @@ -0,0 +1,88 @@ +'use strict'; + +// Load modules + +const Crypto = require('crypto'); +const Boom = require('boom'); + + +// Declare internals + +const internals = {}; + + +// Generate a cryptographically strong pseudo-random data + +exports.randomString = function (size) { + + const buffer = exports.randomBits((size + 1) * 6); + if (buffer instanceof Error) { + return buffer; + } + + const string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); + return string.slice(0, size); +}; + + +// Return a random string of digits + +exports.randomDigits = function (size) { + + const buffer = exports.randomBits(size * 8); + if (buffer instanceof Error) { + return buffer; + } + + const digits = []; + for (let i = 0; i < buffer.length; ++i) { + digits.push(Math.floor(buffer[i] / 25.6)); + } + + return digits.join(''); +}; + + +// Generate a buffer of random bits + +exports.randomBits = function (bits) { + + if (!bits || + bits < 0) { + + return Boom.internal('Invalid random bits count'); + } + + const bytes = Math.ceil(bits / 8); + try { + return Crypto.randomBytes(bytes); + } + catch (err) { + return Boom.internal('Failed generating random bits: ' + err.message); + } +}; + + +// Compare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match) + +exports.fixedTimeComparison = function (a, b) { + + if (typeof a !== 'string' || + typeof b !== 'string') { + + return false; + } + + let mismatch = (a.length === b.length ? 0 : 1); + if (mismatch) { + b = a; + } + + for (let i = 0; i < a.length; ++i) { + const ac = a.charCodeAt(i); + const bc = b.charCodeAt(i); + mismatch |= (ac ^ bc); + } + + return (mismatch === 0); +}; diff --git a/node_modules/cryptiles/node_modules/boom/LICENSE b/node_modules/cryptiles/node_modules/boom/LICENSE new file mode 100755 index 0000000..94b91cb --- /dev/null +++ b/node_modules/cryptiles/node_modules/boom/LICENSE @@ -0,0 +1,29 @@ +Copyright (c) 2012-2017, Project contributors. +Copyright (c) 2012-2014, Walmart. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * The names of any contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + * * * + +The complete list of contributors can be found at: https://github.com/hapijs/boom/graphs/contributors diff --git a/node_modules/cryptiles/node_modules/boom/README.md b/node_modules/cryptiles/node_modules/boom/README.md new file mode 100755 index 0000000..50d5b0d --- /dev/null +++ b/node_modules/cryptiles/node_modules/boom/README.md @@ -0,0 +1,784 @@ +![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png) + +HTTP-friendly error objects + +[![Build Status](https://secure.travis-ci.org/hapijs/boom.svg)](http://travis-ci.org/hapijs/boom) +[![Current Version](https://img.shields.io/npm/v/boom.svg)](https://www.npmjs.com/package/boom) + +Lead Maintainer: [Adam Bretz](https://github.com/arb) + + + +- [Boom](#boom) + - [Helper Methods](#helper-methods) + - [`boomify(error, [options])`](#boomifyerror-options) + - [`wrap(error, [statusCode], [message])`](#wraperror-statuscode-message) + - [`create(statusCode, [message], [data])`](#createstatuscode-message-data) + - [HTTP 4xx Errors](#http-4xx-errors) + - [`Boom.badRequest([message], [data])`](#boombadrequestmessage-data) + - [`Boom.unauthorized([message], [scheme], [attributes])`](#boomunauthorizedmessage-scheme-attributes) + - [`Boom.paymentRequired([message], [data])`](#boompaymentrequiredmessage-data) + - [`Boom.forbidden([message], [data])`](#boomforbiddenmessage-data) + - [`Boom.notFound([message], [data])`](#boomnotfoundmessage-data) + - [`Boom.methodNotAllowed([message], [data], [allow])`](#boommethodnotallowedmessage-data-allow) + - [`Boom.notAcceptable([message], [data])`](#boomnotacceptablemessage-data) + - [`Boom.proxyAuthRequired([message], [data])`](#boomproxyauthrequiredmessage-data) + - [`Boom.clientTimeout([message], [data])`](#boomclienttimeoutmessage-data) + - [`Boom.conflict([message], [data])`](#boomconflictmessage-data) + - [`Boom.resourceGone([message], [data])`](#boomresourcegonemessage-data) + - [`Boom.lengthRequired([message], [data])`](#boomlengthrequiredmessage-data) + - [`Boom.preconditionFailed([message], [data])`](#boompreconditionfailedmessage-data) + - [`Boom.entityTooLarge([message], [data])`](#boomentitytoolargemessage-data) + - [`Boom.uriTooLong([message], [data])`](#boomuritoolongmessage-data) + - [`Boom.unsupportedMediaType([message], [data])`](#boomunsupportedmediatypemessage-data) + - [`Boom.rangeNotSatisfiable([message], [data])`](#boomrangenotsatisfiablemessage-data) + - [`Boom.expectationFailed([message], [data])`](#boomexpectationfailedmessage-data) + - [`Boom.teapot([message], [data])`](#boomteapotmessage-data) + - [`Boom.badData([message], [data])`](#boombaddatamessage-data) + - [`Boom.locked([message], [data])`](#boomlockedmessage-data) + - [`Boom.preconditionRequired([message], [data])`](#boompreconditionrequiredmessage-data) + - [`Boom.tooManyRequests([message], [data])`](#boomtoomanyrequestsmessage-data) + - [`Boom.illegal([message], [data])`](#boomillegalmessage-data) + - [HTTP 5xx Errors](#http-5xx-errors) + - [`Boom.badImplementation([message], [data])` - (*alias: `internal`*)](#boombadimplementationmessage-data---alias-internal) + - [`Boom.notImplemented([message], [data])`](#boomnotimplementedmessage-data) + - [`Boom.badGateway([message], [data])`](#boombadgatewaymessage-data) + - [`Boom.serverUnavailable([message], [data])`](#boomserverunavailablemessage-data) + - [`Boom.gatewayTimeout([message], [data])`](#boomgatewaytimeoutmessage-data) + - [F.A.Q.](#faq) + + + +# Boom + +**boom** provides a set of utilities for returning HTTP errors. Each utility returns a `Boom` error response +object (instance of `Error`) which includes the following properties: +- `isBoom` - if `true`, indicates this is a `Boom` object instance. +- `isServer` - convenience bool indicating status code >= 500. +- `message` - the error message. +- `typeof` - the contructor used to create the error (e.g. `Boom.badRequest`). +- `output` - the formatted response. Can be directly manipulated after object construction to return a custom + error response. Allowed root keys: + - `statusCode` - the HTTP status code (typically 4xx or 5xx). + - `headers` - an object containing any HTTP headers where each key is a header name and value is the header content. + - `payload` - the formatted object used as the response payload (stringified). Can be directly manipulated but any + changes will be lost + if `reformat()` is called. Any content allowed and by default includes the following content: + - `statusCode` - the HTTP status code, derived from `error.output.statusCode`. + - `error` - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from `statusCode`. + - `message` - the error message derived from `error.message`. +- inherited `Error` properties. + +The `Boom` object also supports the following method: +- `reformat()` - rebuilds `error.output` using the other object properties. + +## Helper Methods + +### `boomify(error, [options])` + +Decorates an error with the **boom** properties where: +- `error` - the `Error` object to decorate. +- `options` - optional object with the following optional settings: + - `statusCode` - the HTTP status code. Defaults to `500` if no status code is already set. + - `message` - error message string. If the error already has a message, the provided `message` is added as a prefix. + Defaults to no message. + - `override` - if `false`, the `error` provided is a **boom** object, and a `statusCode` or `message` are provided, + the values are ignored. Defaults to `true` (apply the provided `statusCode` and `message` options to the error + regardless of its type, `Error` or **boom** object). + +Note: This method replaces the [`wrap()`](#wraperror-statuscode-message) and changes the default behavior to override +existing **boom** objects with the provided status code and message. + +```js +var error = new Error('Unexpected input'); +Boom.boomify(error, { statusCode: 400 }); +``` + +### `wrap(error, [statusCode], [message])` + +Note: This method is deprecated. + +Decorates an error with the **boom** properties where: +- `error` - the error object to wrap. If `error` is already a **boom** object, returns back the same object. +- `statusCode` - optional HTTP status code. Defaults to `500`. +- `message` - optional message string. If the error already has a message, it adds the message as a prefix. + Defaults to no message. + +```js +var error = new Error('Unexpected input'); +Boom.wrap(error, 400); +``` + +### `create(statusCode, [message], [data])` + +Generates an `Error` object with the **boom** decorations where: +- `statusCode` - an HTTP error code number. Must be greater or equal 400. +- `message` - optional message string. +- `data` - additional error data set to `error.data` property. + +```js +var error = Boom.create(400, 'Bad request', { timestamp: Date.now() }); +``` + +## HTTP 4xx Errors + +### `Boom.badRequest([message], [data])` + +Returns a 400 Bad Request error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badRequest('invalid query'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 400, + "error": "Bad Request", + "message": "invalid query" +} +``` + +### `Boom.unauthorized([message], [scheme], [attributes])` + +Returns a 401 Unauthorized error where: +- `message` - optional message. +- `scheme` can be one of the following: + - an authentication scheme name + - an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header. +- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used + when `scheme` is a string, otherwise it is ignored. Every key/value pair will be included in the + 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the `attributes` key. Alternatively value can be a string which is use to set the value of the scheme, for example setting the token value for negotiate header. If string is used message parameter must be null. + `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as + the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header + will not be present and `isMissing` will be true on the error object. + +If either `scheme` or `attributes` are set, the resultant `Boom` object will have the 'WWW-Authenticate' header set for the response. + +```js +Boom.unauthorized('invalid password'); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password" +}, +"headers" {} +``` + +```js +Boom.unauthorized('invalid password', 'sample'); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password", + "attributes": { + "error": "invalid password" + } +}, +"headers" { + "WWW-Authenticate": "sample error=\"invalid password\"" +} +``` + +```js +Boom.unauthorized(null, 'Negotiate', 'VGhpcyBpcyBhIHRlc3QgdG9rZW4='); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "attributes": "VGhpcyBpcyBhIHRlc3QgdG9rZW4=" +}, +"headers" { + "WWW-Authenticate": "Negotiate VGhpcyBpcyBhIHRlc3QgdG9rZW4=" +} +``` + +```js +Boom.unauthorized('invalid password', 'sample', { ttl: 0, cache: null, foo: 'bar' }); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password", + "attributes": { + "error": "invalid password", + "ttl": 0, + "cache": "", + "foo": "bar" + } +}, +"headers" { + "WWW-Authenticate": "sample ttl=\"0\", cache=\"\", foo=\"bar\", error=\"invalid password\"" +} +``` + +### `Boom.paymentRequired([message], [data])` + +Returns a 402 Payment Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.paymentRequired('bandwidth used'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 402, + "error": "Payment Required", + "message": "bandwidth used" +} +``` + +### `Boom.forbidden([message], [data])` + +Returns a 403 Forbidden error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.forbidden('try again some time'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 403, + "error": "Forbidden", + "message": "try again some time" +} +``` + +### `Boom.notFound([message], [data])` + +Returns a 404 Not Found error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notFound('missing'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 404, + "error": "Not Found", + "message": "missing" +} +``` + +### `Boom.methodNotAllowed([message], [data], [allow])` + +Returns a 405 Method Not Allowed error where: +- `message` - optional message. +- `data` - optional additional error data. +- `allow` - optional string or array of strings (to be combined and separated by ', ') which is set to the 'Allow' header. + +```js +Boom.methodNotAllowed('that method is not allowed'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 405, + "error": "Method Not Allowed", + "message": "that method is not allowed" +} +``` + +### `Boom.notAcceptable([message], [data])` + +Returns a 406 Not Acceptable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notAcceptable('unacceptable'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 406, + "error": "Not Acceptable", + "message": "unacceptable" +} +``` + +### `Boom.proxyAuthRequired([message], [data])` + +Returns a 407 Proxy Authentication Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.proxyAuthRequired('auth missing'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 407, + "error": "Proxy Authentication Required", + "message": "auth missing" +} +``` + +### `Boom.clientTimeout([message], [data])` + +Returns a 408 Request Time-out error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.clientTimeout('timed out'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 408, + "error": "Request Time-out", + "message": "timed out" +} +``` + +### `Boom.conflict([message], [data])` + +Returns a 409 Conflict error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.conflict('there was a conflict'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 409, + "error": "Conflict", + "message": "there was a conflict" +} +``` + +### `Boom.resourceGone([message], [data])` + +Returns a 410 Gone error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.resourceGone('it is gone'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 410, + "error": "Gone", + "message": "it is gone" +} +``` + +### `Boom.lengthRequired([message], [data])` + +Returns a 411 Length Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.lengthRequired('length needed'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 411, + "error": "Length Required", + "message": "length needed" +} +``` + +### `Boom.preconditionFailed([message], [data])` + +Returns a 412 Precondition Failed error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.preconditionFailed(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 412, + "error": "Precondition Failed" +} +``` + +### `Boom.entityTooLarge([message], [data])` + +Returns a 413 Request Entity Too Large error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.entityTooLarge('too big'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 413, + "error": "Request Entity Too Large", + "message": "too big" +} +``` + +### `Boom.uriTooLong([message], [data])` + +Returns a 414 Request-URI Too Large error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.uriTooLong('uri is too long'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 414, + "error": "Request-URI Too Large", + "message": "uri is too long" +} +``` + +### `Boom.unsupportedMediaType([message], [data])` + +Returns a 415 Unsupported Media Type error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.unsupportedMediaType('that media is not supported'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 415, + "error": "Unsupported Media Type", + "message": "that media is not supported" +} +``` + +### `Boom.rangeNotSatisfiable([message], [data])` + +Returns a 416 Requested Range Not Satisfiable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.rangeNotSatisfiable(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 416, + "error": "Requested Range Not Satisfiable" +} +``` + +### `Boom.expectationFailed([message], [data])` + +Returns a 417 Expectation Failed error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.expectationFailed('expected this to work'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 417, + "error": "Expectation Failed", + "message": "expected this to work" +} +``` + +### `Boom.teapot([message], [data])` + +Returns a 418 I'm a Teapot error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.teapot('sorry, no coffee...'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 418, + "error": "I'm a Teapot", + "message": "Sorry, no coffee..." +} +``` + +### `Boom.badData([message], [data])` + +Returns a 422 Unprocessable Entity error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badData('your data is bad and you should feel bad'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 422, + "error": "Unprocessable Entity", + "message": "your data is bad and you should feel bad" +} +``` + +### `Boom.locked([message], [data])` + +Returns a 423 Locked error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.locked('this resource has been locked'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 423, + "error": "Locked", + "message": "this resource has been locked" +} +``` + +### `Boom.preconditionRequired([message], [data])` + +Returns a 428 Precondition Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.preconditionRequired('you must supply an If-Match header'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 428, + "error": "Precondition Required", + "message": "you must supply an If-Match header" +} +``` + +### `Boom.tooManyRequests([message], [data])` + +Returns a 429 Too Many Requests error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.tooManyRequests('you have exceeded your request limit'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 429, + "error": "Too Many Requests", + "message": "you have exceeded your request limit" +} +``` + +### `Boom.illegal([message], [data])` + +Returns a 451 Unavailable For Legal Reasons error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.illegal('you are not permitted to view this resource for legal reasons'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 451, + "error": "Unavailable For Legal Reasons", + "message": "you are not permitted to view this resource for legal reasons" +} +``` + +## HTTP 5xx Errors + +All 500 errors hide your message from the end user. Your message is recorded in the server log. + +### `Boom.badImplementation([message], [data])` - (*alias: `internal`*) + +Returns a 500 Internal Server Error error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badImplementation('terrible implementation'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 500, + "error": "Internal Server Error", + "message": "An internal server error occurred" +} +``` + +### `Boom.notImplemented([message], [data])` + +Returns a 501 Not Implemented error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notImplemented('method not implemented'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 501, + "error": "Not Implemented", + "message": "method not implemented" +} +``` + +### `Boom.badGateway([message], [data])` + +Returns a 502 Bad Gateway error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badGateway('that is a bad gateway'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 502, + "error": "Bad Gateway", + "message": "that is a bad gateway" +} +``` + +### `Boom.serverUnavailable([message], [data])` + +Returns a 503 Service Unavailable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.serverUnavailable('unavailable'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 503, + "error": "Service Unavailable", + "message": "unavailable" +} +``` + +### `Boom.gatewayTimeout([message], [data])` + +Returns a 504 Gateway Time-out error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.gatewayTimeout(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 504, + "error": "Gateway Time-out" +} +``` + +## F.A.Q. + +**Q** How do I include extra information in my responses? `output.payload` is missing `data`, what gives? + +**A** There is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the ["Error transformation"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation. + +--- diff --git a/node_modules/cryptiles/node_modules/boom/lib/index.js b/node_modules/cryptiles/node_modules/boom/lib/index.js new file mode 100755 index 0000000..c57c79d --- /dev/null +++ b/node_modules/cryptiles/node_modules/boom/lib/index.js @@ -0,0 +1,457 @@ +'use strict'; + +// Load modules + +const Hoek = require('hoek'); + + +// Declare internals + +const internals = { + STATUS_CODES: Object.setPrototypeOf({ + '100': 'Continue', + '101': 'Switching Protocols', + '102': 'Processing', + '200': 'OK', + '201': 'Created', + '202': 'Accepted', + '203': 'Non-Authoritative Information', + '204': 'No Content', + '205': 'Reset Content', + '206': 'Partial Content', + '207': 'Multi-Status', + '300': 'Multiple Choices', + '301': 'Moved Permanently', + '302': 'Moved Temporarily', + '303': 'See Other', + '304': 'Not Modified', + '305': 'Use Proxy', + '307': 'Temporary Redirect', + '400': 'Bad Request', + '401': 'Unauthorized', + '402': 'Payment Required', + '403': 'Forbidden', + '404': 'Not Found', + '405': 'Method Not Allowed', + '406': 'Not Acceptable', + '407': 'Proxy Authentication Required', + '408': 'Request Time-out', + '409': 'Conflict', + '410': 'Gone', + '411': 'Length Required', + '412': 'Precondition Failed', + '413': 'Request Entity Too Large', + '414': 'Request-URI Too Large', + '415': 'Unsupported Media Type', + '416': 'Requested Range Not Satisfiable', + '417': 'Expectation Failed', + '418': 'I\'m a teapot', + '422': 'Unprocessable Entity', + '423': 'Locked', + '424': 'Failed Dependency', + '425': 'Unordered Collection', + '426': 'Upgrade Required', + '428': 'Precondition Required', + '429': 'Too Many Requests', + '431': 'Request Header Fields Too Large', + '451': 'Unavailable For Legal Reasons', + '500': 'Internal Server Error', + '501': 'Not Implemented', + '502': 'Bad Gateway', + '503': 'Service Unavailable', + '504': 'Gateway Time-out', + '505': 'HTTP Version Not Supported', + '506': 'Variant Also Negotiates', + '507': 'Insufficient Storage', + '509': 'Bandwidth Limit Exceeded', + '510': 'Not Extended', + '511': 'Network Authentication Required' + }, null) +}; + + +exports.boomify = function (error, options) { + + Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object'); + + options = options || {}; + + if (!error.isBoom) { + return internals.initialize(error, options.statusCode || 500, options.message); + } + + if (options.override === false || // Defaults to true + (!options.statusCode && !options.message)) { + + return error; + } + + return internals.initialize(error, options.statusCode || error.output.statusCode, options.message); +}; + + +exports.wrap = function (error, statusCode, message) { + + Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object'); + Hoek.assert(!error.isBoom || (!statusCode && !message), 'Cannot provide statusCode or message with boom error'); + + return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message)); +}; + + +exports.create = function (statusCode, message, data) { + + return internals.create(statusCode, message, data, exports.create); +}; + + +internals.create = function (statusCode, message, data, ctor) { + + if (message instanceof Error) { + if (data) { + message.data = data; + } + + return exports.wrap(message, statusCode); + } + + const error = new Error(message ? message : undefined); // Avoids settings null message + Error.captureStackTrace(error, ctor); // Filter the stack to our external API + error.data = data || null; + internals.initialize(error, statusCode); + error.typeof = ctor; + + return error; +}; + + +internals.initialize = function (error, statusCode, message) { + + const numberCode = parseInt(statusCode, 10); + Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode); + + error.isBoom = true; + error.isServer = numberCode >= 500; + + if (!error.hasOwnProperty('data')) { + error.data = null; + } + + error.output = { + statusCode: numberCode, + payload: {}, + headers: {} + }; + + error.reformat = internals.reformat; + + if (!message && + !error.message) { + + error.reformat(); + message = error.output.payload.error; + } + + if (message) { + error.message = (message + (error.message ? ': ' + error.message : '')); + error.output.payload.message = error.message; + } + + error.reformat(); + return error; +}; + + +internals.reformat = function () { + + this.output.payload.statusCode = this.output.statusCode; + this.output.payload.error = internals.STATUS_CODES[this.output.statusCode] || 'Unknown'; + + if (this.output.statusCode === 500) { + this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user + } + else if (this.message) { + this.output.payload.message = this.message; + } +}; + + +// 4xx Client Errors + +exports.badRequest = function (message, data) { + + return internals.create(400, message, data, exports.badRequest); +}; + + +exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[]) + + const err = internals.create(401, message, undefined, exports.unauthorized); + + if (!scheme) { + return err; + } + + let wwwAuthenticate = ''; + + if (typeof scheme === 'string') { + + // function (message, scheme, attributes) + + wwwAuthenticate = scheme; + + if (attributes || message) { + err.output.payload.attributes = {}; + } + + if (attributes) { + if (typeof attributes === 'string') { + wwwAuthenticate = wwwAuthenticate + ' ' + Hoek.escapeHeaderAttribute(attributes); + err.output.payload.attributes = attributes; + } + else { + const names = Object.keys(attributes); + for (let i = 0; i < names.length; ++i) { + const name = names[i]; + if (i) { + wwwAuthenticate = wwwAuthenticate + ','; + } + + let value = attributes[name]; + if (value === null || + value === undefined) { // Value can be zero + + value = ''; + } + wwwAuthenticate = wwwAuthenticate + ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; + err.output.payload.attributes[name] = value; + } + } + } + + + if (message) { + if (attributes) { + wwwAuthenticate = wwwAuthenticate + ','; + } + wwwAuthenticate = wwwAuthenticate + ' error="' + Hoek.escapeHeaderAttribute(message) + '"'; + err.output.payload.attributes.error = message; + } + else { + err.isMissing = true; + } + } + else { + + // function (message, wwwAuthenticate[]) + + const wwwArray = scheme; + for (let i = 0; i < wwwArray.length; ++i) { + if (i) { + wwwAuthenticate = wwwAuthenticate + ', '; + } + + wwwAuthenticate = wwwAuthenticate + wwwArray[i]; + } + } + + err.output.headers['WWW-Authenticate'] = wwwAuthenticate; + + return err; +}; + + +exports.paymentRequired = function (message, data) { + + return internals.create(402, message, data, exports.paymentRequired); +}; + + +exports.forbidden = function (message, data) { + + return internals.create(403, message, data, exports.forbidden); +}; + + +exports.notFound = function (message, data) { + + return internals.create(404, message, data, exports.notFound); +}; + + +exports.methodNotAllowed = function (message, data, allow) { + + const err = internals.create(405, message, data, exports.methodNotAllowed); + + if (typeof allow === 'string') { + allow = [allow]; + } + + if (Array.isArray(allow)) { + err.output.headers.Allow = allow.join(', '); + } + + return err; +}; + + +exports.notAcceptable = function (message, data) { + + return internals.create(406, message, data, exports.notAcceptable); +}; + + +exports.proxyAuthRequired = function (message, data) { + + return internals.create(407, message, data, exports.proxyAuthRequired); +}; + + +exports.clientTimeout = function (message, data) { + + return internals.create(408, message, data, exports.clientTimeout); +}; + + +exports.conflict = function (message, data) { + + return internals.create(409, message, data, exports.conflict); +}; + + +exports.resourceGone = function (message, data) { + + return internals.create(410, message, data, exports.resourceGone); +}; + + +exports.lengthRequired = function (message, data) { + + return internals.create(411, message, data, exports.lengthRequired); +}; + + +exports.preconditionFailed = function (message, data) { + + return internals.create(412, message, data, exports.preconditionFailed); +}; + + +exports.entityTooLarge = function (message, data) { + + return internals.create(413, message, data, exports.entityTooLarge); +}; + + +exports.uriTooLong = function (message, data) { + + return internals.create(414, message, data, exports.uriTooLong); +}; + + +exports.unsupportedMediaType = function (message, data) { + + return internals.create(415, message, data, exports.unsupportedMediaType); +}; + + +exports.rangeNotSatisfiable = function (message, data) { + + return internals.create(416, message, data, exports.rangeNotSatisfiable); +}; + + +exports.expectationFailed = function (message, data) { + + return internals.create(417, message, data, exports.expectationFailed); +}; + + +exports.teapot = function (message, data) { + + return internals.create(418, message, data, exports.teapot); +}; + + +exports.badData = function (message, data) { + + return internals.create(422, message, data, exports.badData); +}; + + +exports.locked = function (message, data) { + + return internals.create(423, message, data, exports.locked); +}; + + +exports.preconditionRequired = function (message, data) { + + return internals.create(428, message, data, exports.preconditionRequired); +}; + + +exports.tooManyRequests = function (message, data) { + + return internals.create(429, message, data, exports.tooManyRequests); +}; + + +exports.illegal = function (message, data) { + + return internals.create(451, message, data, exports.illegal); +}; + + +// 5xx Server Errors + +exports.internal = function (message, data, statusCode) { + + return internals.serverError(message, data, statusCode, exports.internal); +}; + + +internals.serverError = function (message, data, statusCode, ctor) { + + if (data instanceof Error && + !data.isBoom) { + + return exports.wrap(data, statusCode, message); + } + + const error = internals.create(statusCode || 500, message, undefined, ctor); + error.data = data; + return error; +}; + + +exports.notImplemented = function (message, data) { + + return internals.serverError(message, data, 501, exports.notImplemented); +}; + + +exports.badGateway = function (message, data) { + + return internals.serverError(message, data, 502, exports.badGateway); +}; + + +exports.serverUnavailable = function (message, data) { + + return internals.serverError(message, data, 503, exports.serverUnavailable); +}; + + +exports.gatewayTimeout = function (message, data) { + + return internals.serverError(message, data, 504, exports.gatewayTimeout); +}; + + +exports.badImplementation = function (message, data) { + + const err = internals.serverError(message, data, 500, exports.badImplementation); + err.isDeveloperError = true; + return err; +}; diff --git a/node_modules/cryptiles/node_modules/boom/package.json b/node_modules/cryptiles/node_modules/boom/package.json new file mode 100644 index 0000000..6dbe18b --- /dev/null +++ b/node_modules/cryptiles/node_modules/boom/package.json @@ -0,0 +1,61 @@ +{ + "_from": "boom@5.x.x", + "_id": "boom@5.2.0", + "_inBundle": false, + "_integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "_location": "/cryptiles/boom", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "boom@5.x.x", + "name": "boom", + "escapedName": "boom", + "rawSpec": "5.x.x", + "saveSpec": null, + "fetchSpec": "5.x.x" + }, + "_requiredBy": [ + "/cryptiles" + ], + "_resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "_shasum": "5dd9da6ee3a5f302077436290cb717d3f4a54e02", + "_spec": "boom@5.x.x", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/cryptiles", + "bugs": { + "url": "https://github.com/hapijs/boom/issues" + }, + "bundleDependencies": false, + "dependencies": { + "hoek": "4.x.x" + }, + "deprecated": false, + "description": "HTTP-friendly error objects", + "devDependencies": { + "code": "4.x.x", + "lab": "14.x.x", + "markdown-toc": "0.12.x" + }, + "engines": { + "node": ">=4.0.0" + }, + "homepage": "https://github.com/hapijs/boom#readme", + "keywords": [ + "error", + "http" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", + "name": "boom", + "repository": { + "type": "git", + "url": "git://github.com/hapijs/boom.git" + }, + "scripts": { + "test": "lab -a code -t 100 -L -v", + "test-cov-html": "lab -a code -r html -o coverage.html -L", + "toc": "node generate-toc.js", + "version": "npm run toc && git add README.md" + }, + "version": "5.2.0" +} diff --git a/node_modules/cryptiles/package.json b/node_modules/cryptiles/package.json new file mode 100755 index 0000000..3687d63 --- /dev/null +++ b/node_modules/cryptiles/package.json @@ -0,0 +1,61 @@ +{ + "_from": "cryptiles@3.x.x", + "_id": "cryptiles@3.1.2", + "_inBundle": false, + "_integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "_location": "/cryptiles", + "_phantomChildren": { + "hoek": "4.2.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "cryptiles@3.x.x", + "name": "cryptiles", + "escapedName": "cryptiles", + "rawSpec": "3.x.x", + "saveSpec": null, + "fetchSpec": "3.x.x" + }, + "_requiredBy": [ + "/hawk" + ], + "_resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "_shasum": "a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe", + "_spec": "cryptiles@3.x.x", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/hawk", + "bugs": { + "url": "https://github.com/hapijs/cryptiles/issues" + }, + "bundleDependencies": false, + "dependencies": { + "boom": "5.x.x" + }, + "deprecated": false, + "description": "General purpose crypto utilities", + "devDependencies": { + "code": "4.x.x", + "lab": "13.x.x" + }, + "engines": { + "node": ">=4.0.0" + }, + "homepage": "https://github.com/hapijs/cryptiles#readme", + "keywords": [ + "cryptography", + "security", + "utilites" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", + "name": "cryptiles", + "repository": { + "type": "git", + "url": "git://github.com/hapijs/cryptiles.git" + }, + "scripts": { + "test": "lab -a code -t 100 -L", + "test-cov-html": "lab -a code -r html -o coverage.html" + }, + "version": "3.1.2" +} diff --git a/node_modules/cssom/LICENSE.txt b/node_modules/cssom/LICENSE.txt new file mode 100644 index 0000000..bc57aac --- /dev/null +++ b/node_modules/cssom/LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) Nikita Vasilyev + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/cssom/README.mdown b/node_modules/cssom/README.mdown new file mode 100644 index 0000000..1e7c440 --- /dev/null +++ b/node_modules/cssom/README.mdown @@ -0,0 +1,69 @@ +# CSSOM + +CSSOM.js is a CSS parser written in pure JavaScript. It also a partial implementation of [CSS Object Model](http://dev.w3.org/csswg/cssom/). + + CSSOM.parse("body {color: black}") + -> { + cssRules: [ + { + selectorText: "body", + style: { + 0: "color", + color: "black", + length: 1 + } + } + ] + } + + +## [Parser demo](http://nv.github.com/CSSOM/docs/parse.html) + +Works well in Google Chrome 6+, Safari 5+, Firefox 3.6+, Opera 10.63+. +Doesn't work in IE < 9 because of unsupported getters/setters. + +To use CSSOM.js in the browser you might want to build a one-file version that exposes CSSOM global variable: + + ➤ git clone https://github.com/NV/CSSOM.git + ➤ cd CSSOM + ➤ npm install -d + ➤ ./node_modules/.bin/jake + build/CSSOM.js is done + +To use it with Node.js or any other CommonJS loader: + + ➤ npm install cssom + +## Don’t use it if... + +You parse CSS to mungle, minify or reformat the following code: + +```css +div { + background: gray; + background: linear-gradient(to bottom, white 0%, black 100%); +} +``` + +This pattern is often used to give browsers that don’t understand linear gradients a fallback solution (e.g. gray color in the example). +In CSSOM, `background: gray` [gets overwritten](http://nv.github.io/CSSOM/docs/parse.html#css=div%20%7B%0A%20%20%20%20%20%20background%3A%20gray%3B%0A%20%20%20%20background%3A%20linear-gradient(to%20bottom%2C%20white%200%25%2C%20black%20100%25)%3B%0A%7D). +The last same-name property always overwrites all the previous ones. + + +If you do CSS mungling, minification, image inlining, and such, CSSOM.js is no good for you, considere using one of the following: + + * [postcss](https://github.com/postcss/postcss) + * [reworkcss/css](https://github.com/reworkcss/css) + * [csso](https://github.com/css/csso) + * [mensch](https://github.com/brettstimmerman/mensch) + + +## [Specs](http://nv.github.com/CSSOM/spec/) + +To run specs locally: + + ➤ git submodule init + ➤ git submodule update + + +## [Who uses CSSOM.js](https://github.com/NV/CSSOM/wiki/Who-uses-CSSOM.js) diff --git a/node_modules/cssom/lib/CSSDocumentRule.js b/node_modules/cssom/lib/CSSDocumentRule.js new file mode 100644 index 0000000..aec0776 --- /dev/null +++ b/node_modules/cssom/lib/CSSDocumentRule.js @@ -0,0 +1,39 @@ +//.CommonJS +var CSSOM = { + CSSRule: require("./CSSRule").CSSRule, + MatcherList: require("./MatcherList").MatcherList +}; +///CommonJS + + +/** + * @constructor + * @see https://developer.mozilla.org/en/CSS/@-moz-document + */ +CSSOM.CSSDocumentRule = function CSSDocumentRule() { + CSSOM.CSSRule.call(this); + this.matcher = new CSSOM.MatcherList(); + this.cssRules = []; +}; + +CSSOM.CSSDocumentRule.prototype = new CSSOM.CSSRule(); +CSSOM.CSSDocumentRule.prototype.constructor = CSSOM.CSSDocumentRule; +CSSOM.CSSDocumentRule.prototype.type = 10; +//FIXME +//CSSOM.CSSDocumentRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule; +//CSSOM.CSSDocumentRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule; + +Object.defineProperty(CSSOM.CSSDocumentRule.prototype, "cssText", { + get: function() { + var cssTexts = []; + for (var i=0, length=this.cssRules.length; i < length; i++) { + cssTexts.push(this.cssRules[i].cssText); + } + return "@-moz-document " + this.matcher.matcherText + " {" + cssTexts.join("") + "}"; + } +}); + + +//.CommonJS +exports.CSSDocumentRule = CSSOM.CSSDocumentRule; +///CommonJS diff --git a/node_modules/cssom/lib/CSSFontFaceRule.js b/node_modules/cssom/lib/CSSFontFaceRule.js new file mode 100644 index 0000000..7a537fb --- /dev/null +++ b/node_modules/cssom/lib/CSSFontFaceRule.js @@ -0,0 +1,36 @@ +//.CommonJS +var CSSOM = { + CSSStyleDeclaration: require("./CSSStyleDeclaration").CSSStyleDeclaration, + CSSRule: require("./CSSRule").CSSRule +}; +///CommonJS + + +/** + * @constructor + * @see http://dev.w3.org/csswg/cssom/#css-font-face-rule + */ +CSSOM.CSSFontFaceRule = function CSSFontFaceRule() { + CSSOM.CSSRule.call(this); + this.style = new CSSOM.CSSStyleDeclaration(); + this.style.parentRule = this; +}; + +CSSOM.CSSFontFaceRule.prototype = new CSSOM.CSSRule(); +CSSOM.CSSFontFaceRule.prototype.constructor = CSSOM.CSSFontFaceRule; +CSSOM.CSSFontFaceRule.prototype.type = 5; +//FIXME +//CSSOM.CSSFontFaceRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule; +//CSSOM.CSSFontFaceRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule; + +// http://www.opensource.apple.com/source/WebCore/WebCore-955.66.1/css/WebKitCSSFontFaceRule.cpp +Object.defineProperty(CSSOM.CSSFontFaceRule.prototype, "cssText", { + get: function() { + return "@font-face {" + this.style.cssText + "}"; + } +}); + + +//.CommonJS +exports.CSSFontFaceRule = CSSOM.CSSFontFaceRule; +///CommonJS diff --git a/node_modules/cssom/lib/CSSHostRule.js b/node_modules/cssom/lib/CSSHostRule.js new file mode 100644 index 0000000..365304f --- /dev/null +++ b/node_modules/cssom/lib/CSSHostRule.js @@ -0,0 +1,37 @@ +//.CommonJS +var CSSOM = { + CSSRule: require("./CSSRule").CSSRule +}; +///CommonJS + + +/** + * @constructor + * @see http://www.w3.org/TR/shadow-dom/#host-at-rule + */ +CSSOM.CSSHostRule = function CSSHostRule() { + CSSOM.CSSRule.call(this); + this.cssRules = []; +}; + +CSSOM.CSSHostRule.prototype = new CSSOM.CSSRule(); +CSSOM.CSSHostRule.prototype.constructor = CSSOM.CSSHostRule; +CSSOM.CSSHostRule.prototype.type = 1001; +//FIXME +//CSSOM.CSSHostRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule; +//CSSOM.CSSHostRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule; + +Object.defineProperty(CSSOM.CSSHostRule.prototype, "cssText", { + get: function() { + var cssTexts = []; + for (var i=0, length=this.cssRules.length; i < length; i++) { + cssTexts.push(this.cssRules[i].cssText); + } + return "@host {" + cssTexts.join("") + "}"; + } +}); + + +//.CommonJS +exports.CSSHostRule = CSSOM.CSSHostRule; +///CommonJS diff --git a/node_modules/cssom/lib/CSSImportRule.js b/node_modules/cssom/lib/CSSImportRule.js new file mode 100644 index 0000000..0398105 --- /dev/null +++ b/node_modules/cssom/lib/CSSImportRule.js @@ -0,0 +1,132 @@ +//.CommonJS +var CSSOM = { + CSSRule: require("./CSSRule").CSSRule, + CSSStyleSheet: require("./CSSStyleSheet").CSSStyleSheet, + MediaList: require("./MediaList").MediaList +}; +///CommonJS + + +/** + * @constructor + * @see http://dev.w3.org/csswg/cssom/#cssimportrule + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule + */ +CSSOM.CSSImportRule = function CSSImportRule() { + CSSOM.CSSRule.call(this); + this.href = ""; + this.media = new CSSOM.MediaList(); + this.styleSheet = new CSSOM.CSSStyleSheet(); +}; + +CSSOM.CSSImportRule.prototype = new CSSOM.CSSRule(); +CSSOM.CSSImportRule.prototype.constructor = CSSOM.CSSImportRule; +CSSOM.CSSImportRule.prototype.type = 3; + +Object.defineProperty(CSSOM.CSSImportRule.prototype, "cssText", { + get: function() { + var mediaText = this.media.mediaText; + return "@import url(" + this.href + ")" + (mediaText ? " " + mediaText : "") + ";"; + }, + set: function(cssText) { + var i = 0; + + /** + * @import url(partial.css) screen, handheld; + * || | + * after-import media + * | + * url + */ + var state = ''; + + var buffer = ''; + var index; + for (var character; (character = cssText.charAt(i)); i++) { + + switch (character) { + case ' ': + case '\t': + case '\r': + case '\n': + case '\f': + if (state === 'after-import') { + state = 'url'; + } else { + buffer += character; + } + break; + + case '@': + if (!state && cssText.indexOf('@import', i) === i) { + state = 'after-import'; + i += 'import'.length; + buffer = ''; + } + break; + + case 'u': + if (state === 'url' && cssText.indexOf('url(', i) === i) { + index = cssText.indexOf(')', i + 1); + if (index === -1) { + throw i + ': ")" not found'; + } + i += 'url('.length; + var url = cssText.slice(i, index); + if (url[0] === url[url.length - 1]) { + if (url[0] === '"' || url[0] === "'") { + url = url.slice(1, -1); + } + } + this.href = url; + i = index; + state = 'media'; + } + break; + + case '"': + if (state === 'url') { + index = cssText.indexOf('"', i + 1); + if (!index) { + throw i + ": '\"' not found"; + } + this.href = cssText.slice(i + 1, index); + i = index; + state = 'media'; + } + break; + + case "'": + if (state === 'url') { + index = cssText.indexOf("'", i + 1); + if (!index) { + throw i + ': "\'" not found'; + } + this.href = cssText.slice(i + 1, index); + i = index; + state = 'media'; + } + break; + + case ';': + if (state === 'media') { + if (buffer) { + this.media.mediaText = buffer.trim(); + } + } + break; + + default: + if (state === 'media') { + buffer += character; + } + break; + } + } + } +}); + + +//.CommonJS +exports.CSSImportRule = CSSOM.CSSImportRule; +///CommonJS diff --git a/node_modules/cssom/lib/CSSKeyframeRule.js b/node_modules/cssom/lib/CSSKeyframeRule.js new file mode 100644 index 0000000..c22f2f5 --- /dev/null +++ b/node_modules/cssom/lib/CSSKeyframeRule.js @@ -0,0 +1,37 @@ +//.CommonJS +var CSSOM = { + CSSRule: require("./CSSRule").CSSRule, + CSSStyleDeclaration: require('./CSSStyleDeclaration').CSSStyleDeclaration +}; +///CommonJS + + +/** + * @constructor + * @see http://www.w3.org/TR/css3-animations/#DOM-CSSKeyframeRule + */ +CSSOM.CSSKeyframeRule = function CSSKeyframeRule() { + CSSOM.CSSRule.call(this); + this.keyText = ''; + this.style = new CSSOM.CSSStyleDeclaration(); + this.style.parentRule = this; +}; + +CSSOM.CSSKeyframeRule.prototype = new CSSOM.CSSRule(); +CSSOM.CSSKeyframeRule.prototype.constructor = CSSOM.CSSKeyframeRule; +CSSOM.CSSKeyframeRule.prototype.type = 9; +//FIXME +//CSSOM.CSSKeyframeRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule; +//CSSOM.CSSKeyframeRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule; + +// http://www.opensource.apple.com/source/WebCore/WebCore-955.66.1/css/WebKitCSSKeyframeRule.cpp +Object.defineProperty(CSSOM.CSSKeyframeRule.prototype, "cssText", { + get: function() { + return this.keyText + " {" + this.style.cssText + "} "; + } +}); + + +//.CommonJS +exports.CSSKeyframeRule = CSSOM.CSSKeyframeRule; +///CommonJS diff --git a/node_modules/cssom/lib/CSSKeyframesRule.js b/node_modules/cssom/lib/CSSKeyframesRule.js new file mode 100644 index 0000000..7e42717 --- /dev/null +++ b/node_modules/cssom/lib/CSSKeyframesRule.js @@ -0,0 +1,39 @@ +//.CommonJS +var CSSOM = { + CSSRule: require("./CSSRule").CSSRule +}; +///CommonJS + + +/** + * @constructor + * @see http://www.w3.org/TR/css3-animations/#DOM-CSSKeyframesRule + */ +CSSOM.CSSKeyframesRule = function CSSKeyframesRule() { + CSSOM.CSSRule.call(this); + this.name = ''; + this.cssRules = []; +}; + +CSSOM.CSSKeyframesRule.prototype = new CSSOM.CSSRule(); +CSSOM.CSSKeyframesRule.prototype.constructor = CSSOM.CSSKeyframesRule; +CSSOM.CSSKeyframesRule.prototype.type = 8; +//FIXME +//CSSOM.CSSKeyframesRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule; +//CSSOM.CSSKeyframesRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule; + +// http://www.opensource.apple.com/source/WebCore/WebCore-955.66.1/css/WebKitCSSKeyframesRule.cpp +Object.defineProperty(CSSOM.CSSKeyframesRule.prototype, "cssText", { + get: function() { + var cssTexts = []; + for (var i=0, length=this.cssRules.length; i < length; i++) { + cssTexts.push(" " + this.cssRules[i].cssText); + } + return "@" + (this._vendorPrefix || '') + "keyframes " + this.name + " { \n" + cssTexts.join("\n") + "\n}"; + } +}); + + +//.CommonJS +exports.CSSKeyframesRule = CSSOM.CSSKeyframesRule; +///CommonJS diff --git a/node_modules/cssom/lib/CSSMediaRule.js b/node_modules/cssom/lib/CSSMediaRule.js new file mode 100644 index 0000000..367a35e --- /dev/null +++ b/node_modules/cssom/lib/CSSMediaRule.js @@ -0,0 +1,41 @@ +//.CommonJS +var CSSOM = { + CSSRule: require("./CSSRule").CSSRule, + MediaList: require("./MediaList").MediaList +}; +///CommonJS + + +/** + * @constructor + * @see http://dev.w3.org/csswg/cssom/#cssmediarule + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule + */ +CSSOM.CSSMediaRule = function CSSMediaRule() { + CSSOM.CSSRule.call(this); + this.media = new CSSOM.MediaList(); + this.cssRules = []; +}; + +CSSOM.CSSMediaRule.prototype = new CSSOM.CSSRule(); +CSSOM.CSSMediaRule.prototype.constructor = CSSOM.CSSMediaRule; +CSSOM.CSSMediaRule.prototype.type = 4; +//FIXME +//CSSOM.CSSMediaRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule; +//CSSOM.CSSMediaRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule; + +// http://opensource.apple.com/source/WebCore/WebCore-658.28/css/CSSMediaRule.cpp +Object.defineProperty(CSSOM.CSSMediaRule.prototype, "cssText", { + get: function() { + var cssTexts = []; + for (var i=0, length=this.cssRules.length; i < length; i++) { + cssTexts.push(this.cssRules[i].cssText); + } + return "@media " + this.media.mediaText + " {" + cssTexts.join("") + "}"; + } +}); + + +//.CommonJS +exports.CSSMediaRule = CSSOM.CSSMediaRule; +///CommonJS diff --git a/node_modules/cssom/lib/CSSOM.js b/node_modules/cssom/lib/CSSOM.js new file mode 100644 index 0000000..95f3563 --- /dev/null +++ b/node_modules/cssom/lib/CSSOM.js @@ -0,0 +1,3 @@ +var CSSOM = {}; + + diff --git a/node_modules/cssom/lib/CSSRule.js b/node_modules/cssom/lib/CSSRule.js new file mode 100644 index 0000000..0b5e25b --- /dev/null +++ b/node_modules/cssom/lib/CSSRule.js @@ -0,0 +1,43 @@ +//.CommonJS +var CSSOM = {}; +///CommonJS + + +/** + * @constructor + * @see http://dev.w3.org/csswg/cssom/#the-cssrule-interface + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule + */ +CSSOM.CSSRule = function CSSRule() { + this.parentRule = null; + this.parentStyleSheet = null; +}; + +CSSOM.CSSRule.UNKNOWN_RULE = 0; // obsolete +CSSOM.CSSRule.STYLE_RULE = 1; +CSSOM.CSSRule.CHARSET_RULE = 2; // obsolete +CSSOM.CSSRule.IMPORT_RULE = 3; +CSSOM.CSSRule.MEDIA_RULE = 4; +CSSOM.CSSRule.FONT_FACE_RULE = 5; +CSSOM.CSSRule.PAGE_RULE = 6; +CSSOM.CSSRule.KEYFRAMES_RULE = 7; +CSSOM.CSSRule.KEYFRAME_RULE = 8; +CSSOM.CSSRule.MARGIN_RULE = 9; +CSSOM.CSSRule.NAMESPACE_RULE = 10; +CSSOM.CSSRule.COUNTER_STYLE_RULE = 11; +CSSOM.CSSRule.SUPPORTS_RULE = 12; +CSSOM.CSSRule.DOCUMENT_RULE = 13; +CSSOM.CSSRule.FONT_FEATURE_VALUES_RULE = 14; +CSSOM.CSSRule.VIEWPORT_RULE = 15; +CSSOM.CSSRule.REGION_STYLE_RULE = 16; + + +CSSOM.CSSRule.prototype = { + constructor: CSSOM.CSSRule + //FIXME +}; + + +//.CommonJS +exports.CSSRule = CSSOM.CSSRule; +///CommonJS diff --git a/node_modules/cssom/lib/CSSStyleDeclaration.js b/node_modules/cssom/lib/CSSStyleDeclaration.js new file mode 100644 index 0000000..b43b9af --- /dev/null +++ b/node_modules/cssom/lib/CSSStyleDeclaration.js @@ -0,0 +1,148 @@ +//.CommonJS +var CSSOM = {}; +///CommonJS + + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration + */ +CSSOM.CSSStyleDeclaration = function CSSStyleDeclaration(){ + this.length = 0; + this.parentRule = null; + + // NON-STANDARD + this._importants = {}; +}; + + +CSSOM.CSSStyleDeclaration.prototype = { + + constructor: CSSOM.CSSStyleDeclaration, + + /** + * + * @param {string} name + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyValue + * @return {string} the value of the property if it has been explicitly set for this declaration block. + * Returns the empty string if the property has not been set. + */ + getPropertyValue: function(name) { + return this[name] || ""; + }, + + /** + * + * @param {string} name + * @param {string} value + * @param {string} [priority=null] "important" or null + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-setProperty + */ + setProperty: function(name, value, priority) { + if (this[name]) { + // Property already exist. Overwrite it. + var index = Array.prototype.indexOf.call(this, name); + if (index < 0) { + this[this.length] = name; + this.length++; + } + } else { + // New property. + this[this.length] = name; + this.length++; + } + this[name] = value + ""; + this._importants[name] = priority; + }, + + /** + * + * @param {string} name + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-removeProperty + * @return {string} the value of the property if it has been explicitly set for this declaration block. + * Returns the empty string if the property has not been set or the property name does not correspond to a known CSS property. + */ + removeProperty: function(name) { + if (!(name in this)) { + return ""; + } + var index = Array.prototype.indexOf.call(this, name); + if (index < 0) { + return ""; + } + var prevValue = this[name]; + this[name] = ""; + + // That's what WebKit and Opera do + Array.prototype.splice.call(this, index, 1); + + // That's what Firefox does + //this[index] = "" + + return prevValue; + }, + + getPropertyCSSValue: function() { + //FIXME + }, + + /** + * + * @param {String} name + */ + getPropertyPriority: function(name) { + return this._importants[name] || ""; + }, + + + /** + * element.style.overflow = "auto" + * element.style.getPropertyShorthand("overflow-x") + * -> "overflow" + */ + getPropertyShorthand: function() { + //FIXME + }, + + isPropertyImplicit: function() { + //FIXME + }, + + // Doesn't work in IE < 9 + get cssText(){ + var properties = []; + for (var i=0, length=this.length; i < length; ++i) { + var name = this[i]; + var value = this.getPropertyValue(name); + var priority = this.getPropertyPriority(name); + if (priority) { + priority = " !" + priority; + } + properties[i] = name + ": " + value + priority + ";"; + } + return properties.join(" "); + }, + + set cssText(text){ + var i, name; + for (i = this.length; i--;) { + name = this[i]; + this[name] = ""; + } + Array.prototype.splice.call(this, 0, this.length); + this._importants = {}; + + var dummyRule = CSSOM.parse('#bogus{' + text + '}').cssRules[0].style; + var length = dummyRule.length; + for (i = 0; i < length; ++i) { + name = dummyRule[i]; + this.setProperty(dummyRule[i], dummyRule.getPropertyValue(name), dummyRule.getPropertyPriority(name)); + } + } +}; + + +//.CommonJS +exports.CSSStyleDeclaration = CSSOM.CSSStyleDeclaration; +CSSOM.parse = require('./parse').parse; // Cannot be included sooner due to the mutual dependency between parse.js and CSSStyleDeclaration.js +///CommonJS diff --git a/node_modules/cssom/lib/CSSStyleRule.js b/node_modules/cssom/lib/CSSStyleRule.js new file mode 100644 index 0000000..630b3f8 --- /dev/null +++ b/node_modules/cssom/lib/CSSStyleRule.js @@ -0,0 +1,190 @@ +//.CommonJS +var CSSOM = { + CSSStyleDeclaration: require("./CSSStyleDeclaration").CSSStyleDeclaration, + CSSRule: require("./CSSRule").CSSRule +}; +///CommonJS + + +/** + * @constructor + * @see http://dev.w3.org/csswg/cssom/#cssstylerule + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule + */ +CSSOM.CSSStyleRule = function CSSStyleRule() { + CSSOM.CSSRule.call(this); + this.selectorText = ""; + this.style = new CSSOM.CSSStyleDeclaration(); + this.style.parentRule = this; +}; + +CSSOM.CSSStyleRule.prototype = new CSSOM.CSSRule(); +CSSOM.CSSStyleRule.prototype.constructor = CSSOM.CSSStyleRule; +CSSOM.CSSStyleRule.prototype.type = 1; + +Object.defineProperty(CSSOM.CSSStyleRule.prototype, "cssText", { + get: function() { + var text; + if (this.selectorText) { + text = this.selectorText + " {" + this.style.cssText + "}"; + } else { + text = ""; + } + return text; + }, + set: function(cssText) { + var rule = CSSOM.CSSStyleRule.parse(cssText); + this.style = rule.style; + this.selectorText = rule.selectorText; + } +}); + + +/** + * NON-STANDARD + * lightweight version of parse.js. + * @param {string} ruleText + * @return CSSStyleRule + */ +CSSOM.CSSStyleRule.parse = function(ruleText) { + var i = 0; + var state = "selector"; + var index; + var j = i; + var buffer = ""; + + var SIGNIFICANT_WHITESPACE = { + "selector": true, + "value": true + }; + + var styleRule = new CSSOM.CSSStyleRule(); + var name, priority=""; + + for (var character; (character = ruleText.charAt(i)); i++) { + + switch (character) { + + case " ": + case "\t": + case "\r": + case "\n": + case "\f": + if (SIGNIFICANT_WHITESPACE[state]) { + // Squash 2 or more white-spaces in the row into 1 + switch (ruleText.charAt(i - 1)) { + case " ": + case "\t": + case "\r": + case "\n": + case "\f": + break; + default: + buffer += " "; + break; + } + } + break; + + // String + case '"': + j = i + 1; + index = ruleText.indexOf('"', j) + 1; + if (!index) { + throw '" is missing'; + } + buffer += ruleText.slice(i, index); + i = index - 1; + break; + + case "'": + j = i + 1; + index = ruleText.indexOf("'", j) + 1; + if (!index) { + throw "' is missing"; + } + buffer += ruleText.slice(i, index); + i = index - 1; + break; + + // Comment + case "/": + if (ruleText.charAt(i + 1) === "*") { + i += 2; + index = ruleText.indexOf("*/", i); + if (index === -1) { + throw new SyntaxError("Missing */"); + } else { + i = index + 1; + } + } else { + buffer += character; + } + break; + + case "{": + if (state === "selector") { + styleRule.selectorText = buffer.trim(); + buffer = ""; + state = "name"; + } + break; + + case ":": + if (state === "name") { + name = buffer.trim(); + buffer = ""; + state = "value"; + } else { + buffer += character; + } + break; + + case "!": + if (state === "value" && ruleText.indexOf("!important", i) === i) { + priority = "important"; + i += "important".length; + } else { + buffer += character; + } + break; + + case ";": + if (state === "value") { + styleRule.style.setProperty(name, buffer.trim(), priority); + priority = ""; + buffer = ""; + state = "name"; + } else { + buffer += character; + } + break; + + case "}": + if (state === "value") { + styleRule.style.setProperty(name, buffer.trim(), priority); + priority = ""; + buffer = ""; + } else if (state === "name") { + break; + } else { + buffer += character; + } + state = "selector"; + break; + + default: + buffer += character; + break; + + } + } + + return styleRule; + +}; + + +//.CommonJS +exports.CSSStyleRule = CSSOM.CSSStyleRule; +///CommonJS diff --git a/node_modules/cssom/lib/CSSStyleSheet.js b/node_modules/cssom/lib/CSSStyleSheet.js new file mode 100644 index 0000000..f0e0dfc --- /dev/null +++ b/node_modules/cssom/lib/CSSStyleSheet.js @@ -0,0 +1,88 @@ +//.CommonJS +var CSSOM = { + StyleSheet: require("./StyleSheet").StyleSheet, + CSSStyleRule: require("./CSSStyleRule").CSSStyleRule +}; +///CommonJS + + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet + */ +CSSOM.CSSStyleSheet = function CSSStyleSheet() { + CSSOM.StyleSheet.call(this); + this.cssRules = []; +}; + + +CSSOM.CSSStyleSheet.prototype = new CSSOM.StyleSheet(); +CSSOM.CSSStyleSheet.prototype.constructor = CSSOM.CSSStyleSheet; + + +/** + * Used to insert a new rule into the style sheet. The new rule now becomes part of the cascade. + * + * sheet = new Sheet("body {margin: 0}") + * sheet.toString() + * -> "body{margin:0;}" + * sheet.insertRule("img {border: none}", 0) + * -> 0 + * sheet.toString() + * -> "img{border:none;}body{margin:0;}" + * + * @param {string} rule + * @param {number} index + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-insertRule + * @return {number} The index within the style sheet's rule collection of the newly inserted rule. + */ +CSSOM.CSSStyleSheet.prototype.insertRule = function(rule, index) { + if (index < 0 || index > this.cssRules.length) { + throw new RangeError("INDEX_SIZE_ERR"); + } + var cssRule = CSSOM.parse(rule).cssRules[0]; + cssRule.parentStyleSheet = this; + this.cssRules.splice(index, 0, cssRule); + return index; +}; + + +/** + * Used to delete a rule from the style sheet. + * + * sheet = new Sheet("img{border:none} body{margin:0}") + * sheet.toString() + * -> "img{border:none;}body{margin:0;}" + * sheet.deleteRule(0) + * sheet.toString() + * -> "body{margin:0;}" + * + * @param {number} index within the style sheet's rule list of the rule to remove. + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-deleteRule + */ +CSSOM.CSSStyleSheet.prototype.deleteRule = function(index) { + if (index < 0 || index >= this.cssRules.length) { + throw new RangeError("INDEX_SIZE_ERR"); + } + this.cssRules.splice(index, 1); +}; + + +/** + * NON-STANDARD + * @return {string} serialize stylesheet + */ +CSSOM.CSSStyleSheet.prototype.toString = function() { + var result = ""; + var rules = this.cssRules; + for (var i=0; i 1000 ? '1000px' : 'auto'); + * } + */ +CSSOM.CSSValueExpression.prototype.parse = function() { + var token = this._token, + idx = this._idx; + + var character = '', + expression = '', + error = '', + info, + paren = []; + + + for (; ; ++idx) { + character = token.charAt(idx); + + // end of token + if (character === '') { + error = 'css expression error: unfinished expression!'; + break; + } + + switch(character) { + case '(': + paren.push(character); + expression += character; + break; + + case ')': + paren.pop(character); + expression += character; + break; + + case '/': + if ((info = this._parseJSComment(token, idx))) { // comment? + if (info.error) { + error = 'css expression error: unfinished comment in expression!'; + } else { + idx = info.idx; + // ignore the comment + } + } else if ((info = this._parseJSRexExp(token, idx))) { // regexp + idx = info.idx; + expression += info.text; + } else { // other + expression += character; + } + break; + + case "'": + case '"': + info = this._parseJSString(token, idx, character); + if (info) { // string + idx = info.idx; + expression += info.text; + } else { + expression += character; + } + break; + + default: + expression += character; + break; + } + + if (error) { + break; + } + + // end of expression + if (paren.length === 0) { + break; + } + } + + var ret; + if (error) { + ret = { + error: error + }; + } else { + ret = { + idx: idx, + expression: expression + }; + } + + return ret; +}; + + +/** + * + * @return {Object|false} + * - idx: + * - text: + * or + * - error: + * or + * false + * + */ +CSSOM.CSSValueExpression.prototype._parseJSComment = function(token, idx) { + var nextChar = token.charAt(idx + 1), + text; + + if (nextChar === '/' || nextChar === '*') { + var startIdx = idx, + endIdx, + commentEndChar; + + if (nextChar === '/') { // line comment + commentEndChar = '\n'; + } else if (nextChar === '*') { // block comment + commentEndChar = '*/'; + } + + endIdx = token.indexOf(commentEndChar, startIdx + 1 + 1); + if (endIdx !== -1) { + endIdx = endIdx + commentEndChar.length - 1; + text = token.substring(idx, endIdx + 1); + return { + idx: endIdx, + text: text + }; + } else { + var error = 'css expression error: unfinished comment in expression!'; + return { + error: error + }; + } + } else { + return false; + } +}; + + +/** + * + * @return {Object|false} + * - idx: + * - text: + * or + * false + * + */ +CSSOM.CSSValueExpression.prototype._parseJSString = function(token, idx, sep) { + var endIdx = this._findMatchedIdx(token, idx, sep), + text; + + if (endIdx === -1) { + return false; + } else { + text = token.substring(idx, endIdx + sep.length); + + return { + idx: endIdx, + text: text + }; + } +}; + + +/** + * parse regexp in css expression + * + * @return {Object|false} + * - idx: + * - regExp: + * or + * false + */ + +/* + +all legal RegExp + +/a/ +(/a/) +[/a/] +[12, /a/] + +!/a/ + ++/a/ +-/a/ +* /a/ +/ /a/ +%/a/ + +===/a/ +!==/a/ +==/a/ +!=/a/ +>/a/ +>=/a/ +>/a/ +>>>/a/ + +&&/a/ +||/a/ +?/a/ +=/a/ +,/a/ + + delete /a/ + in /a/ +instanceof /a/ + new /a/ + typeof /a/ + void /a/ + +*/ +CSSOM.CSSValueExpression.prototype._parseJSRexExp = function(token, idx) { + var before = token.substring(0, idx).replace(/\s+$/, ""), + legalRegx = [ + /^$/, + /\($/, + /\[$/, + /\!$/, + /\+$/, + /\-$/, + /\*$/, + /\/\s+/, + /\%$/, + /\=$/, + /\>$/, + /<$/, + /\&$/, + /\|$/, + /\^$/, + /\~$/, + /\?$/, + /\,$/, + /delete$/, + /in$/, + /instanceof$/, + /new$/, + /typeof$/, + /void$/ + ]; + + var isLegal = legalRegx.some(function(reg) { + return reg.test(before); + }); + + if (!isLegal) { + return false; + } else { + var sep = '/'; + + // same logic as string + return this._parseJSString(token, idx, sep); + } +}; + + +/** + * + * find next sep(same line) index in `token` + * + * @return {Number} + * + */ +CSSOM.CSSValueExpression.prototype._findMatchedIdx = function(token, idx, sep) { + var startIdx = idx, + endIdx; + + var NOT_FOUND = -1; + + while(true) { + endIdx = token.indexOf(sep, startIdx + 1); + + if (endIdx === -1) { // not found + endIdx = NOT_FOUND; + break; + } else { + var text = token.substring(idx + 1, endIdx), + matched = text.match(/\\+$/); + if (!matched || matched[0] % 2 === 0) { // not escaped + break; + } else { + startIdx = endIdx; + } + } + } + + // boundary must be in the same line(js sting or regexp) + var nextNewLineIdx = token.indexOf('\n', idx + 1); + if (nextNewLineIdx < endIdx) { + endIdx = NOT_FOUND; + } + + + return endIdx; +}; + + + + +//.CommonJS +exports.CSSValueExpression = CSSOM.CSSValueExpression; +///CommonJS diff --git a/node_modules/cssom/lib/MatcherList.js b/node_modules/cssom/lib/MatcherList.js new file mode 100644 index 0000000..a791585 --- /dev/null +++ b/node_modules/cssom/lib/MatcherList.js @@ -0,0 +1,62 @@ +//.CommonJS +var CSSOM = {}; +///CommonJS + + +/** + * @constructor + * @see https://developer.mozilla.org/en/CSS/@-moz-document + */ +CSSOM.MatcherList = function MatcherList(){ + this.length = 0; +}; + +CSSOM.MatcherList.prototype = { + + constructor: CSSOM.MatcherList, + + /** + * @return {string} + */ + get matcherText() { + return Array.prototype.join.call(this, ", "); + }, + + /** + * @param {string} value + */ + set matcherText(value) { + // just a temporary solution, actually it may be wrong by just split the value with ',', because a url can include ','. + var values = value.split(","); + var length = this.length = values.length; + for (var i=0; i= 0.3.2 < 0.4.0", + "_id": "cssom@0.3.2", + "_inBundle": false, + "_integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", + "_location": "/cssom", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "cssom@>= 0.3.2 < 0.4.0", + "name": "cssom", + "escapedName": "cssom", + "rawSpec": ">= 0.3.2 < 0.4.0", + "saveSpec": null, + "fetchSpec": ">= 0.3.2 < 0.4.0" + }, + "_requiredBy": [ + "/cssstyle", + "/jsdom" + ], + "_resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", + "_shasum": "b8036170c79f07a90ff2f16e22284027a243848b", + "_spec": "cssom@>= 0.3.2 < 0.4.0", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/jsdom", + "author": { + "name": "Nikita Vasilyev", + "email": "me@elv1s.ru" + }, + "bugs": { + "url": "https://github.com/NV/CSSOM/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "CSS Object Model implementation and CSS parser", + "devDependencies": { + "jake": "~0.7.3" + }, + "files": [ + "lib/" + ], + "homepage": "https://github.com/NV/CSSOM#readme", + "keywords": [ + "CSS", + "CSSOM", + "parser", + "styleSheet" + ], + "license": "MIT", + "main": "./lib/index.js", + "name": "cssom", + "repository": { + "type": "git", + "url": "git+https://github.com/NV/CSSOM.git" + }, + "scripts": { + "prepublish": "jake lib/index.js" + }, + "version": "0.3.2" +} diff --git a/node_modules/cssstyle/.npmignore b/node_modules/cssstyle/.npmignore new file mode 100644 index 0000000..2d51347 --- /dev/null +++ b/node_modules/cssstyle/.npmignore @@ -0,0 +1 @@ +node_module diff --git a/node_modules/cssstyle/MIT-LICENSE.txt b/node_modules/cssstyle/MIT-LICENSE.txt new file mode 100644 index 0000000..060a7e6 --- /dev/null +++ b/node_modules/cssstyle/MIT-LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) Chad Walker + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/cssstyle/README.md b/node_modules/cssstyle/README.md new file mode 100644 index 0000000..80f3365 --- /dev/null +++ b/node_modules/cssstyle/README.md @@ -0,0 +1,27 @@ +CSSStyleDeclaration +=================== + +CSSStyleDeclaration is a work-a-like to the CSSStyleDeclaration class in Nikita Vasilyev's [CSSOM](https://github.com/NV/CSSOM). I made it so that when using [jQuery in node](https://github.com/tmtk75/node-jquery) setting css attributes via $.fn.css() would work. node-jquery uses [jsdom](https://github.com/tmpvar/jsdom) to create a DOM to use in node. jsdom uses CSSOM for styling, and CSSOM's implementation of the [CSSStyleDeclaration](http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration) doesn't support [CSS2Properties](http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties), which is how jQuery's [$.fn.css()](http://api.jquery.com/css/) operates. + + +Why not just issue a pull request? +---- +Well, NV wants to keep CSSOM fast (which I can appreciate) and CSS2Properties aren't required by the standard (though every browser has the interface). So I figured the path of least resistence would be to just modify this one class, publish it as a node module (that requires CSSOM) and then make a pull request of jsdom to use it. + +How do I test this code? +--- +`npm test` should do the trick, assuming you have the dev dependencies installed: +> ``` +> $ npm test +> +> tests +> ✔ Verify Has Properties +> ✔ Verify Has Functions +> ✔ Verify Has Special Properties +> ✔ Test From Style String +> ✔ Test From Properties +> ✔ Test Shorthand Properties +> ✔ Test width and height Properties and null and empty strings +> ✔ Test Implicit Properties +> ``` + diff --git a/node_modules/cssstyle/lib/CSSStyleDeclaration.js b/node_modules/cssstyle/lib/CSSStyleDeclaration.js new file mode 100644 index 0000000..4f2049e --- /dev/null +++ b/node_modules/cssstyle/lib/CSSStyleDeclaration.js @@ -0,0 +1,233 @@ +/********************************************************************* + * This is a fork from the CSS Style Declaration part of + * https://github.com/NV/CSSOM + ********************************************************************/ +"use strict"; +var CSSOM = require('cssom'); +var fs = require('fs'); +var path = require('path'); + +var camelToDashed = require('./parsers').camelToDashed; +var dashedToCamelCase = require('./parsers').dashedToCamelCase; + +/** + * @constructor + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration + */ +var CSSStyleDeclaration = function CSSStyleDeclaration(onChangeCallback) { + this._values = {}; + this._importants = {}; + this._length = 0; + this._onChange = onChangeCallback || function () { return; }; +}; +CSSStyleDeclaration.prototype = { + constructor: CSSStyleDeclaration, + + /** + * + * @param {string} name + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyValue + * @return {string} the value of the property if it has been explicitly set for this declaration block. + * Returns the empty string if the property has not been set. + */ + getPropertyValue: function (name) { + if (!this._values.hasOwnProperty(name)) { + return ""; + } + return this._values[name].toString(); + }, + + /** + * + * @param {string} name + * @param {string} value + * @param {string} [priority=null] "important" or null + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-setProperty + */ + setProperty: function (name, value, priority) { + if (value === undefined) { + return; + } + if (value === null || value === '') { + this.removeProperty(name); + return; + } + var camel_case = dashedToCamelCase(name); + this[camel_case] = value; + this._importants[name] = priority; + }, + _setProperty: function (name, value, priority) { + if (value === undefined) { + return; + } + if (value === null || value === '') { + this.removeProperty(name); + return; + } + if (this._values[name]) { + // Property already exist. Overwrite it. + var index = Array.prototype.indexOf.call(this, name); + if (index < 0) { + this[this._length] = name; + this._length++; + } + } else { + // New property. + this[this._length] = name; + this._length++; + } + this._values[name] = value; + this._importants[name] = priority; + this._onChange(this.cssText); + }, + + /** + * + * @param {string} name + * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-removeProperty + * @return {string} the value of the property if it has been explicitly set for this declaration block. + * Returns the empty string if the property has not been set or the property name does not correspond to a known CSS property. + */ + removeProperty: function (name) { + if (!this._values.hasOwnProperty(name)) { + return ""; + } + + var prevValue = this._values[name]; + delete this._values[name]; + delete this._importants[name]; + + var index = Array.prototype.indexOf.call(this, name); + if (index < 0) { + return prevValue; + } + + // That's what WebKit and Opera do + Array.prototype.splice.call(this, index, 1); + + // That's what Firefox does + //this[index] = "" + + this._onChange(this.cssText); + return prevValue; + }, + + + /** + * + * @param {String} name + */ + getPropertyPriority: function (name) { + return this._importants[name] || ""; + }, + + + getPropertyCSSValue: function () { + //FIXME + return; + }, + + /** + * element.style.overflow = "auto" + * element.style.getPropertyShorthand("overflow-x") + * -> "overflow" + */ + getPropertyShorthand: function () { + //FIXME + return; + }, + + isPropertyImplicit: function () { + //FIXME + return; + }, + + /** + * http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-item + */ + item: function (index) { + index = parseInt(index, 10); + if (index < 0 || index >= this._length) { + return ''; + } + return this[index]; + } +}; + +Object.defineProperties(CSSStyleDeclaration.prototype, { + cssText: { + get: function () { + var properties = []; + var i; + var name; + var value; + var priority; + for (i = 0; i < this._length; i++) { + name = this[i]; + value = this.getPropertyValue(name); + priority = this.getPropertyPriority(name); + if (priority !== '') { + priority = " !" + priority; + } + properties.push([name, ': ', value, priority, ';'].join('')); + } + return properties.join(' '); + }, + set: function (value) { + var i; + this._values = {}; + Array.prototype.splice.call(this, 0, this._length); + this._importants = {}; + var dummyRule; + try { + dummyRule = CSSOM.parse('#bogus{' + value + '}').cssRules[0].style; + } catch (err) { + // malformed css, just return + return; + } + var rule_length = dummyRule.length; + var name; + for (i = 0; i < rule_length; ++i) { + name = dummyRule[i]; + this.setProperty(dummyRule[i], dummyRule.getPropertyValue(name), dummyRule.getPropertyPriority(name)); + } + this._onChange(this.cssText); + }, + enumerable: true, + configurable: true + }, + parentRule: { + get: function () { return null; }, + enumerable: true, + configurable: true + }, + length: { + get: function () { return this._length; }, + /** + * This deletes indices if the new length is less then the current + * length. If the new length is more, it does nothing, the new indices + * will be undefined until set. + **/ + set: function (value) { + var i; + for (i = value; i < this._length; i++) { + delete this[i]; + } + this._length = value; + }, + enumerable: true, + configurable: true + }, + 'float': { + get: function () { return this.cssFloat; }, + set: function (value) { + this.cssFloat = value; + }, + enumerable: true, + configurable: true + } +}); + +require('./properties')(CSSStyleDeclaration.prototype); + +exports.CSSStyleDeclaration = CSSStyleDeclaration; diff --git a/node_modules/cssstyle/lib/parsers.js b/node_modules/cssstyle/lib/parsers.js new file mode 100644 index 0000000..c5d6bdd --- /dev/null +++ b/node_modules/cssstyle/lib/parsers.js @@ -0,0 +1,670 @@ +/********************************************************************* + * These are commonly used parsers for CSS Values they take a string * + * to parse and return a string after it's been converted, if needed * + ********************************************************************/ +'use strict'; + +exports.TYPES = { + INTEGER: 1, + NUMBER: 2, + LENGTH: 3, + PERCENT: 4, + URL: 5, + COLOR: 6, + STRING: 7, + ANGLE: 8, + KEYWORD: 9, + NULL_OR_EMPTY_STR: 10 +}; + +/*jslint regexp: true*/ +// rough regular expressions +var integerRegEx = /^[\-+]?[0-9]+$/; +var numberRegEx = /^[\-+]?[0-9]*\.[0-9]+$/; +var lengthRegEx = /^(0|[\-+]?[0-9]*\.?[0-9]+(in|cm|em|mm|pt|pc|px))$/; +var percentRegEx = /^[\-+]?[0-9]*\.?[0-9]+%$/; +var urlRegEx = /^url\(\s*([^\)]*)\s*\)$/; +var stringRegEx = /^(\"[^\"]*\"|\'[^\']*\')$/; +var colorRegEx1 = /^#[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])?$/; +var colorRegEx2 = /^rgb\(([^\)]*)\)$/; +var colorRegEx3 = /^rgba\(([^\)]*)\)$/; +var angleRegEx = /^([\-+]?[0-9]*\.?[0-9]+)(deg|grad|rad)$/; +/*jslint regexp: false*/ + +// This will return one of the above types based on the passed in string +exports.valueType = function valueType(val) { + if (val === '' || val === null) { + return exports.TYPES.NULL_OR_EMPTY_STR; + } + if (typeof val === 'number') { + val = val.toString(); + } + + if (typeof val !== 'string') { + return undefined; + } + + if (integerRegEx.test(val)) { + return exports.TYPES.INTEGER; + } + if (numberRegEx.test(val)) { + return exports.TYPES.NUMBER; + } + if (lengthRegEx.test(val)) { + return exports.TYPES.LENGTH; + } + if (percentRegEx.test(val)) { + return exports.TYPES.PERCENT; + } + if (urlRegEx.test(val)) { + return exports.TYPES.URL; + } + if (stringRegEx.test(val)) { + return exports.TYPES.STRING; + } + if (angleRegEx.test(val)) { + return exports.TYPES.ANGLE; + } + if (colorRegEx1.test(val)) { + return exports.TYPES.COLOR; + } + var res = colorRegEx2.exec(val); + var parts; + if (res !== null) { + parts = res[1].split(/\s*,\s*/); + if (parts.length !== 3) { + return undefined; + } + if (parts.every(percentRegEx.test.bind(percentRegEx)) || parts.every(integerRegEx.test.bind(integerRegEx))) { + return exports.TYPES.COLOR; + } + return undefined; + } + res = colorRegEx3.exec(val); + if (res !== null) { + parts = res[1].split(/\s*,\s*/); + if (parts.length !== 4) { + return undefined; + } + if (parts.slice(0, 3).every(percentRegEx.test.bind(percentRegEx)) || parts.every(integerRegEx.test.bind(integerRegEx))) { + if (numberRegEx.test(parts[3])) { + return exports.TYPES.COLOR; + } + } + return undefined; + } + + // could still be a color, one of the standard keyword colors + val = val.toLowerCase(); + switch (val) { + case 'maroon': + case 'red': + case 'orange': + case 'yellow': + case 'olive': + case 'purple': + case 'fuchsia': + case 'white': + case 'lime': + case 'green': + case 'navy': + case 'blue': + case 'aqua': + case 'teal': + case 'black': + case 'silver': + case 'gray': + // the following are deprecated in CSS3 + case 'activeborder': + case 'activecaption': + case 'appworkspace': + case 'background': + case 'buttonface': + case 'buttonhighlight': + case 'buttonshadow': + case 'buttontext': + case 'captiontext': + case 'graytext': + case 'highlight': + case 'highlighttext': + case 'inactiveborder': + case 'inactivecaption': + case 'inactivecaptiontext': + case 'infobackground': + case 'infotext': + case 'menu': + case 'menutext': + case 'scrollbar': + case 'threeddarkshadow': + case 'threedface': + case 'threedhighlight': + case 'threedlightshadow': + case 'threedshadow': + case 'window': + case 'windowframe': + case 'windowtext': + return exports.TYPES.COLOR; + default: + return exports.TYPES.KEYWORD; + } +}; + +exports.parseInteger = function parseInteger(val) { + var type = exports.valueType(val); + if (type === exports.TYPES.NULL_OR_EMPTY_STR) { + return val; + } + if (type !== exports.TYPES.INTEGER) { + return undefined; + } + return String(parseInt(val, 10)); +}; + +exports.parseNumber = function parseNumber(val) { + var type = exports.valueType(val); + if (type === exports.TYPES.NULL_OR_EMPTY_STR) { + return val; + } + if (type !== exports.TYPES.NUMBER && type !== exports.TYPES.INTEGER) { + return undefined; + } + return String(parseFloat(val)); +}; + +exports.parseLength = function parseLength(val) { + if (val === 0 || val === '0') { + return '0px'; + } + var type = exports.valueType(val); + if (type === exports.TYPES.NULL_OR_EMPTY_STR) { + return val; + } + if (type !== exports.TYPES.LENGTH) { + return undefined; + } + return val; +}; + +exports.parsePercent = function parsePercent(val) { + if (val === 0 || val === '0') { + return '0%'; + } + var type = exports.valueType(val); + if (type === exports.TYPES.NULL_OR_EMPTY_STR) { + return val; + } + if (type !== exports.TYPES.PERCENT) { + return undefined; + } + return val; +}; + +// either a length or a percent +exports.parseMeasurement = function parseMeasurement(val) { + var length = exports.parseLength(val); + if (length !== undefined) { + return length; + } + return exports.parsePercent(val); +}; + +exports.parseUrl = function parseUrl(val) { + var type = exports.valueType(val); + if (type === exports.TYPES.NULL_OR_EMPTY_STR) { + return val; + } + var res = urlRegEx.exec(val); + // does it match the regex? + if (!res) { + return undefined; + } + var str = res[1]; + // if it starts with single or double quotes, does it end with the same? + if ((str[0] === '"' || str[0] === "'") && str[0] !== str[str.length - 1]) { + return undefined; + } + if (str[0] === '"' || str[0] === "'") { + str = str.substr(1, str.length - 2); + } + + var i; + for (i = 0; i < str.length; i++) { + switch (str[i]) { + case '(': + case ')': + case ' ': + case '\t': + case '\n': + case "'": + case '"': + return undefined; + case '\\': + i++; + break; + } + } + + return 'url(' + str + ')'; +}; + +exports.parseString = function parseString(val) { + var type = exports.valueType(val); + if (type === exports.TYPES.NULL_OR_EMPTY_STR) { + return val; + } + if (type !== exports.TYPES.STRING) { + return undefined; + } + var i; + for (i = 1; i < val.length - 1; i++) { + switch (val[i]) { + case val[0]: + return undefined; + case '\\': + i++; + while (i < val.length - 1 && /[0-9A-Fa-f]/.test(val[i])) { + i++; + } + break; + } + } + if (i >= val.length) { + return undefined; + } + return val; +}; + +exports.parseColor = function parseColor(val) { + var type = exports.valueType(val); + if (type === exports.TYPES.NULL_OR_EMPTY_STR) { + return val; + } + var red, green, blue, alpha = 1; + var parts; + var res = colorRegEx1.exec(val); + // is it #aaa or #ababab + if (res) { + var hex = val.substr(1); + if (hex.length === 3) { + hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; + } + red = parseInt(hex.substr(0, 2), 16); + green = parseInt(hex.substr(2, 2), 16); + blue = parseInt(hex.substr(4, 2), 16); + return 'rgb(' + red + ', ' + green + ', ' + blue + ')'; + } + + res = colorRegEx2.exec(val); + if (res) { + parts = res[1].split(/\s*,\s*/); + if (parts.length !== 3) { + return undefined; + } + if (parts.every(percentRegEx.test.bind(percentRegEx))) { + red = Math.floor(parseFloat(parts[0].slice(0, -1)) * 255 / 100); + green = Math.floor(parseFloat(parts[1].slice(0, -1)) * 255 / 100); + blue = Math.floor(parseFloat(parts[2].slice(0, -1)) * 255 / 100); + } else if (parts.every(integerRegEx.test.bind(integerRegEx))) { + red = parseInt(parts[0], 10); + green = parseInt(parts[1], 10); + blue = parseInt(parts[2], 10); + } else { + return undefined; + } + red = Math.min(255, Math.max(0, red)); + green = Math.min(255, Math.max(0, green)); + blue = Math.min(255, Math.max(0, blue)); + return 'rgb(' + red + ', ' + green + ', ' + blue + ')'; + } + + res = colorRegEx3.exec(val); + if (res) { + parts = res[1].split(/\s*,\s*/); + if (parts.length !== 4) { + return undefined; + } + if (parts.slice(0, 3).every(percentRegEx.test.bind(percentRegEx))) { + red = Math.floor(parseFloat(parts[0].slice(0, -1)) * 255 / 100); + green = Math.floor(parseFloat(parts[1].slice(0, -1)) * 255 / 100); + blue = Math.floor(parseFloat(parts[2].slice(0, -1)) * 255 / 100); + alpha = parseFloat(parts[3]); + } else if (parts.slice(0, 3).every(integerRegEx.test.bind(integerRegEx))) { + red = parseInt(parts[0], 10); + green = parseInt(parts[1], 10); + blue = parseInt(parts[2], 10); + alpha = parseFloat(parts[3]); + } else { + return undefined; + } + if (isNaN(alpha)) { + alpha = 1; + } + red = Math.min(255, Math.max(0, red)); + green = Math.min(255, Math.max(0, green)); + blue = Math.min(255, Math.max(0, blue)); + alpha = Math.min(1, Math.max(0, alpha)); + if (alpha === 1) { + return 'rgb(' + red + ', ' + green + ', ' + blue + ')'; + } + return 'rgba(' + red + ', ' + green + ', ' + blue + ', ' + alpha + ')'; + } + + if (type === exports.TYPES.COLOR) { + return val; + } + return undefined; +}; + +exports.parseAngle = function parseAngle(val) { + var type = exports.valueType(val); + if (type === exports.TYPES.NULL_OR_EMPTY_STR) { + return val; + } + if (type !== exports.TYPES.ANGLE) { + return undefined; + } + var res = angleRegEx.exec(val); + var flt = parseFloat(res[1]); + if (res[2] === 'rad') { + flt *= 180 / Math.PI; + } else if (res[2] === 'grad') { + flt *= 360 / 400; + } + + while (flt < 0) { + flt += 360; + } + while (flt > 360) { + flt -= 360; + } + return flt + 'deg'; +}; + +exports.parseKeyword = function parseKeyword(val, valid_keywords) { + var type = exports.valueType(val); + if (type === exports.TYPES.NULL_OR_EMPTY_STR) { + return val; + } + if (type !== exports.TYPES.KEYWORD) { + return undefined; + } + val = val.toString().toLowerCase(); + var i; + for (i = 0; i < valid_keywords.length; i++) { + if (valid_keywords[i].toLowerCase() === val) { + return valid_keywords[i]; + } + } + return undefined; +}; + +// utility to translate from border-width to borderWidth +var dashedToCamelCase = function (dashed) { + var i; + var camel = ''; + var nextCap = false; + for (i = 0; i < dashed.length; i++) { + if (dashed[i] !== '-') { + camel += nextCap ? dashed[i].toUpperCase() : dashed[i]; + nextCap = false; + } else { + nextCap = true; + } + } + return camel; +}; +exports.dashedToCamelCase = dashedToCamelCase; + +var is_space = /\s/; +var opening_deliminators = ['"', '\'', '(']; +var closing_deliminators = ['"', '\'', ')']; +// this splits on whitespace, but keeps quoted and parened parts together +var getParts = function (str) { + var deliminator_stack = []; + var length = str.length; + var i; + var parts = []; + var current_part = ''; + var opening_index; + var closing_index; + for (i = 0; i < length; i++) { + opening_index = opening_deliminators.indexOf(str[i]); + closing_index = closing_deliminators.indexOf(str[i]); + if (is_space.test(str[i])) { + if (deliminator_stack.length === 0) { + if (current_part !== '') { + parts.push(current_part); + } + current_part = ''; + } else { + current_part += str[i]; + } + } else { + if (str[i] === '\\') { + i++; + current_part += str[i]; + } else { + current_part += str[i]; + if (closing_index !== -1 && closing_index === deliminator_stack[deliminator_stack.length - 1]) { + deliminator_stack.pop(); + } else if (opening_index !== -1) { + deliminator_stack.push(opening_index); + } + } + } + } + if (current_part !== '') { + parts.push(current_part); + } + return parts; +}; + +/* + * this either returns undefined meaning that it isn't valid + * or returns an object where the keys are dashed short + * hand properties and the values are the values to set + * on them + */ +exports.shorthandParser = function parse(v, shorthand_for) { + var obj = {}; + var type = exports.valueType(v); + if (type === exports.TYPES.NULL_OR_EMPTY_STR) { + Object.keys(shorthand_for).forEach(function (property) { + obj[property] = ''; + }); + return obj; + } + + if (typeof v === 'number') { + v = v.toString(); + } + + if (typeof v !== 'string') { + return undefined; + } + + if (v.toLowerCase() === 'inherit') { + return {}; + } + var parts = getParts(v); + var valid = true; + parts.forEach(function (part) { + var part_valid = false; + Object.keys(shorthand_for).forEach(function (property) { + if (shorthand_for[property].isValid(part)) { + part_valid = true; + obj[property] = part; + } + }); + valid = valid && part_valid; + }); + if (!valid) { + return undefined; + } + return obj; +}; + +exports.shorthandSetter = function (property, shorthand_for) { + return function (v) { + var obj = exports.shorthandParser(v, shorthand_for); + if (obj === undefined) { + return; + } + //console.log('shorthandSetter for:', property, 'obj:', obj); + Object.keys(obj).forEach(function (subprop) { + // in case subprop is an implicit property, this will clear + // *its* subpropertiesX + var camel = dashedToCamelCase(subprop); + this[camel] = obj[subprop]; + // in case it gets translated into something else (0 -> 0px) + obj[subprop] = this[camel]; + this.removeProperty(subprop); + // don't add in empty properties + if (obj[subprop] !== '') { + this._values[subprop] = obj[subprop]; + } + }, this); + Object.keys(shorthand_for).forEach(function (subprop) { + if (!obj.hasOwnProperty(subprop)) { + this.removeProperty(subprop); + delete this._values[subprop]; + } + }, this); + // in case the value is something like 'none' that removes all values, + // check that the generated one is not empty, first remove the property + // if it already exists, then call the shorthandGetter, if it's an empty + // string, don't set the property + this.removeProperty(property); + var calculated = exports.shorthandGetter(property, shorthand_for).call(this); + if (calculated !== '') { + this._setProperty(property, calculated); + } + }; +}; + +exports.shorthandGetter = function (property, shorthand_for) { + return function () { + if (this._values[property] !== undefined) { + return this.getPropertyValue(property); + } + return Object.keys(shorthand_for).map(function (subprop) { + return this.getPropertyValue(subprop); + }, this).filter(function (value) { + return value !== ''; + }).join(' '); + }; +}; + +// isValid(){1,4} | inherit +// if one, it applies to all +// if two, the first applies to the top and bottom, and the second to left and right +// if three, the first applies to the top, the second to left and right, the third bottom +// if four, top, right, bottom, left +exports.implicitSetter = function (property_before, property_after, isValid, parser) { + property_after = property_after || ''; + if (property_after !== '') { + property_after = '-' + property_after; + } + var part_names = ["top","right","bottom","left"]; + + return function (v) { + if (typeof v === 'number') { + v = v.toString(); + } + if (typeof v !== 'string') { + return undefined; + } + var parts; + if (v.toLowerCase() === 'inherit' || v === '') { + parts = [v]; + } else { + parts = getParts(v); + } + if (parts.length < 1 || parts.length > 4) { + return undefined; + } + + if (!parts.every(isValid)) { + return undefined; + } + + parts = parts.map(function (part) { + return parser(part); + }); + this._setProperty(property_before + property_after, parts.join(' ')); + if (parts.length === 1) { + parts[1] = parts[0]; + } + if (parts.length === 2) { + parts[2] = parts[0]; + } + if (parts.length === 3) { + parts[3] = parts[1]; + } + + for (var i = 0; i < 4; i++) { + var property = property_before + "-" + part_names[i] + property_after; + this.removeProperty(property); + if (parts[i] !== '') { + this._values[property] = parts[i]; + } + } + return v; + }; +}; + +// +// Companion to implicitSetter, but for the individual parts. +// This sets the individual value, and checks to see if all four +// sub-parts are set. If so, it sets the shorthand version and removes +// the individual parts from the cssText. +// +exports.subImplicitSetter = function (prefix, part, isValid, parser) { + var property = prefix + '-' + part; + var subparts = [prefix+"-top", prefix+"-right", prefix+"-bottom", prefix+"-left"]; + + return function (v) { + if (typeof v === 'number') { + v = v.toString(); + } + if (typeof v !== 'string') { + return undefined; + } + if (!isValid(v)) { + return undefined; + } + v = parser(v); + this._setProperty(property,v); + var parts = []; + for (var i = 0; i < 4; i++) { + if (this._values[subparts[i]] == null || this._values[subparts[i]] === '') { + break; + } + parts.push(this._values[subparts[i]]); + } + if (parts.length === 4) { + for (i = 0; i < 4; i++) { + this.removeProperty(subparts[i]); + this._values[subparts[i]] = parts[i]; + } + this._setProperty(prefix,parts.join(" ")); + } + return v; + }; +}; + + +var camel_to_dashed = /[A-Z]/g; +/*jslint regexp: true*/ +var first_segment = /^\([^\-]\)-/; +/*jslint regexp: false*/ +var vendor_prefixes = ['o', 'moz', 'ms', 'webkit']; +exports.camelToDashed = function (camel_case) { + var match; + var dashed = camel_case.replace(camel_to_dashed, '-$&').toLowerCase(); + match = dashed.match(first_segment); + if (match && vendor_prefixes.indexOf(match[1]) !== -1) { + dashed = '-' + dashed; + } + return dashed; +}; diff --git a/node_modules/cssstyle/lib/properties.js b/node_modules/cssstyle/lib/properties.js new file mode 100644 index 0000000..be126cc --- /dev/null +++ b/node_modules/cssstyle/lib/properties.js @@ -0,0 +1,5858 @@ +'use strict'; + +// autogenerated + +/* + * + * http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties + */ + +var external_dependency_parsers_0 = require("./parsers.js"); + +var alignmentBaseline_export_definition; +alignmentBaseline_export_definition = { + set: function (v) { + this._setProperty('alignment-baseline', v); + }, + get: function () { + return this.getPropertyValue('alignment-baseline'); + }, + enumerable: true, + configurable: true +}; +var azimuth_export_definition; +azimuth_export_definition = { + set: function (v) { + var valueType = external_dependency_parsers_0.valueType(v); + + if (valueType === external_dependency_parsers_0.TYPES.ANGLE) { + return this._setProperty('azimuth', external_dependency_parsers_0.parseAngle(v)); + } + + if (valueType === external_dependency_parsers_0.TYPES.KEYWORD) { + var keywords = v.toLowerCase().trim().split(/\s+/); + var hasBehind = false; + + if (keywords.length > 2) { + return; + } + + var behindIndex = keywords.indexOf('behind'); + hasBehind = behindIndex !== -1; + + if (keywords.length === 2) { + if (!hasBehind) { + return; + } + + keywords.splice(behindIndex, 1); + } + + if (keywords[0] === 'leftwards' || keywords[0] === 'rightwards') { + if (hasBehind) { + return; + } + + return this._setProperty('azimuth', keywords[0]); + } + + if (keywords[0] === 'behind') { + return this._setProperty('azimuth', '180deg'); + } + + var deg; + + switch (keywords[0]) { + case 'left-side': + return this._setProperty('azimuth', '270deg'); + + case 'far-left': + return this._setProperty('azimuth', (hasBehind ? 240 : 300) + 'deg'); + + case 'left': + return this._setProperty('azimuth', (hasBehind ? 220 : 320) + 'deg'); + + case 'center-left': + return this._setProperty('azimuth', (hasBehind ? 200 : 340) + 'deg'); + + case 'center': + return this._setProperty('azimuth', (hasBehind ? 180 : 0) + 'deg'); + + case 'center-right': + return this._setProperty('azimuth', (hasBehind ? 160 : 20) + 'deg'); + + case 'right': + return this._setProperty('azimuth', (hasBehind ? 140 : 40) + 'deg'); + + case 'far-right': + return this._setProperty('azimuth', (hasBehind ? 120 : 60) + 'deg'); + + case 'right-side': + return this._setProperty('azimuth', '90deg'); + + default: + return; + } + } + }, + get: function () { + return this.getPropertyValue('azimuth'); + }, + enumerable: true, + configurable: true +}; +var backgroundColor_export_isValid, backgroundColor_export_definition; + +var backgroundColor_local_var_parse = function parse(v) { + var parsed = external_dependency_parsers_0.parseColor(v); + + if (parsed !== undefined) { + return parsed; + } + + if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'transparent' || v.toLowerCase() === 'inherit')) { + return v; + } + + return undefined; +}; + +backgroundColor_export_isValid = function isValid(v) { + return backgroundColor_local_var_parse(v) !== undefined; +}; + +backgroundColor_export_definition = { + set: function (v) { + var parsed = backgroundColor_local_var_parse(v); + + if (parsed === undefined) { + return; + } + + this._setProperty('background-color', parsed); + }, + get: function () { + return this.getPropertyValue('background-color'); + }, + enumerable: true, + configurable: true +}; +var backgroundImage_export_isValid, backgroundImage_export_definition; + +var backgroundImage_local_var_parse = function parse(v) { + var parsed = external_dependency_parsers_0.parseUrl(v); + + if (parsed !== undefined) { + return parsed; + } + + if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'none' || v.toLowerCase() === 'inherit')) { + return v; + } + + return undefined; +}; + +backgroundImage_export_isValid = function isValid(v) { + return backgroundImage_local_var_parse(v) !== undefined; +}; + +backgroundImage_export_definition = { + set: function (v) { + this._setProperty('background-image', backgroundImage_local_var_parse(v)); + }, + get: function () { + return this.getPropertyValue('background-image'); + }, + enumerable: true, + configurable: true +}; +var backgroundRepeat_export_isValid, backgroundRepeat_export_definition; + +var backgroundRepeat_local_var_parse = function parse(v) { + if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'repeat' || v.toLowerCase() === 'repeat-x' || v.toLowerCase() === 'repeat-y' || v.toLowerCase() === 'no-repeat' || v.toLowerCase() === 'inherit')) { + return v; + } + + return undefined; +}; + +backgroundRepeat_export_isValid = function isValid(v) { + return backgroundRepeat_local_var_parse(v) !== undefined; +}; + +backgroundRepeat_export_definition = { + set: function (v) { + this._setProperty('background-repeat', backgroundRepeat_local_var_parse(v)); + }, + get: function () { + return this.getPropertyValue('background-repeat'); + }, + enumerable: true, + configurable: true +}; +var backgroundAttachment_export_isValid, backgroundAttachment_export_definition; + +var backgroundAttachment_local_var_isValid = backgroundAttachment_export_isValid = function isValid(v) { + return external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'scroll' || v.toLowerCase() === 'fixed' || v.toLowerCase() === 'inherit'); +}; + +backgroundAttachment_export_definition = { + set: function (v) { + if (!backgroundAttachment_local_var_isValid(v)) { + return; + } + + this._setProperty('background-attachment', v); + }, + get: function () { + return this.getPropertyValue('background-attachment'); + }, + enumerable: true, + configurable: true +}; +var backgroundPosition_export_isValid, backgroundPosition_export_definition; +var backgroundPosition_local_var_valid_keywords = ['top', 'center', 'bottom', 'left', 'right']; + +var backgroundPosition_local_var_parse = function parse(v) { + if (v === '' || v === null) { + return undefined; + } + + var parts = v.split(/\s+/); + + if (parts.length > 2 || parts.length < 1) { + return undefined; + } + + var types = []; + parts.forEach(function (part, index) { + types[index] = external_dependency_parsers_0.valueType(part); + }); + + if (parts.length === 1) { + if (types[0] === external_dependency_parsers_0.TYPES.LENGTH || types[0] === external_dependency_parsers_0.TYPES.PERCENT) { + return v; + } + + if (types[0] === external_dependency_parsers_0.TYPES.KEYWORD) { + if (backgroundPosition_local_var_valid_keywords.indexOf(v.toLowerCase()) !== -1 || v.toLowerCase() === 'inherit') { + return v; + } + } + + return undefined; + } + + if ((types[0] === external_dependency_parsers_0.TYPES.LENGTH || types[0] === external_dependency_parsers_0.TYPES.PERCENT) && (types[1] === external_dependency_parsers_0.TYPES.LENGTH || types[1] === external_dependency_parsers_0.TYPES.PERCENT)) { + return v; + } + + if (types[0] !== external_dependency_parsers_0.TYPES.KEYWORD || types[1] !== external_dependency_parsers_0.TYPES.KEYWORD) { + return undefined; + } + + if (backgroundPosition_local_var_valid_keywords.indexOf(parts[0]) !== -1 && backgroundPosition_local_var_valid_keywords.indexOf(parts[1]) !== -1) { + return v; + } + + return undefined; +}; + +backgroundPosition_export_isValid = function isValid(v) { + return backgroundPosition_local_var_parse(v) !== undefined; +}; + +backgroundPosition_export_definition = { + set: function (v) { + this._setProperty('background-position', backgroundPosition_local_var_parse(v)); + }, + get: function () { + return this.getPropertyValue('background-position'); + }, + enumerable: true, + configurable: true +}; +var background_export_isValid, background_export_definition; +var background_local_var_shorthand_for = { + 'background-color': { + isValid: backgroundColor_export_isValid, + definition: backgroundColor_export_definition + }, + 'background-image': { + isValid: backgroundImage_export_isValid, + definition: backgroundImage_export_definition + }, + 'background-repeat': { + isValid: backgroundRepeat_export_isValid, + definition: backgroundRepeat_export_definition + }, + 'background-attachment': { + isValid: backgroundAttachment_export_isValid, + definition: backgroundAttachment_export_definition + }, + 'background-position': { + isValid: backgroundPosition_export_isValid, + definition: backgroundPosition_export_definition + } +}; + +background_export_isValid = function isValid(v) { + return external_dependency_parsers_0.shorthandParser(v, background_local_var_shorthand_for) !== undefined; +}; + +background_export_definition = { + set: external_dependency_parsers_0.shorthandSetter('background', background_local_var_shorthand_for), + get: external_dependency_parsers_0.shorthandGetter('background', background_local_var_shorthand_for), + enumerable: true, + configurable: true +}; +var backgroundClip_export_definition; +backgroundClip_export_definition = { + set: function (v) { + this._setProperty('background-clip', v); + }, + get: function () { + return this.getPropertyValue('background-clip'); + }, + enumerable: true, + configurable: true +}; +var backgroundOrigin_export_definition; +backgroundOrigin_export_definition = { + set: function (v) { + this._setProperty('background-origin', v); + }, + get: function () { + return this.getPropertyValue('background-origin'); + }, + enumerable: true, + configurable: true +}; +var backgroundPositionX_export_definition; +backgroundPositionX_export_definition = { + set: function (v) { + this._setProperty('background-position-x', v); + }, + get: function () { + return this.getPropertyValue('background-position-x'); + }, + enumerable: true, + configurable: true +}; +var backgroundPositionY_export_definition; +backgroundPositionY_export_definition = { + set: function (v) { + this._setProperty('background-position-y', v); + }, + get: function () { + return this.getPropertyValue('background-position-y'); + }, + enumerable: true, + configurable: true +}; +var backgroundRepeatX_export_definition; +backgroundRepeatX_export_definition = { + set: function (v) { + this._setProperty('background-repeat-x', v); + }, + get: function () { + return this.getPropertyValue('background-repeat-x'); + }, + enumerable: true, + configurable: true +}; +var backgroundRepeatY_export_definition; +backgroundRepeatY_export_definition = { + set: function (v) { + this._setProperty('background-repeat-y', v); + }, + get: function () { + return this.getPropertyValue('background-repeat-y'); + }, + enumerable: true, + configurable: true +}; +var backgroundSize_export_definition; +backgroundSize_export_definition = { + set: function (v) { + this._setProperty('background-size', v); + }, + get: function () { + return this.getPropertyValue('background-size'); + }, + enumerable: true, + configurable: true +}; +var baselineShift_export_definition; +baselineShift_export_definition = { + set: function (v) { + this._setProperty('baseline-shift', v); + }, + get: function () { + return this.getPropertyValue('baseline-shift'); + }, + enumerable: true, + configurable: true +}; +var borderWidth_export_isValid, borderWidth_export_definition; +// the valid border-widths: +var borderWidth_local_var_widths = ['thin', 'medium', 'thick']; + +borderWidth_export_isValid = function parse(v) { + var length = external_dependency_parsers_0.parseLength(v); + + if (length !== undefined) { + return true; + } + + if (typeof v !== 'string') { + return false; + } + + if (v === '') { + return true; + } + + v = v.toLowerCase(); + + if (borderWidth_local_var_widths.indexOf(v) === -1) { + return false; + } + + return true; +}; + +var borderWidth_local_var_isValid = borderWidth_export_isValid; + +var borderWidth_local_var_parser = function (v) { + var length = external_dependency_parsers_0.parseLength(v); + + if (length !== undefined) { + return length; + } + + if (borderWidth_local_var_isValid(v)) { + return v.toLowerCase(); + } + + return undefined; +}; + +borderWidth_export_definition = { + set: external_dependency_parsers_0.implicitSetter('border', 'width', borderWidth_local_var_isValid, borderWidth_local_var_parser), + get: function () { + return this.getPropertyValue('border-width'); + }, + enumerable: true, + configurable: true +}; +var borderStyle_export_isValid, borderStyle_export_definition; +// the valid border-styles: +var borderStyle_local_var_styles = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset']; + +borderStyle_export_isValid = function parse(v) { + return typeof v === 'string' && (v === '' || borderStyle_local_var_styles.indexOf(v) !== -1); +}; + +var borderStyle_local_var_isValid = borderStyle_export_isValid; + +var borderStyle_local_var_parser = function (v) { + if (borderStyle_local_var_isValid(v)) { + return v.toLowerCase(); + } + + return undefined; +}; + +borderStyle_export_definition = { + set: external_dependency_parsers_0.implicitSetter('border', 'style', borderStyle_local_var_isValid, borderStyle_local_var_parser), + get: function () { + return this.getPropertyValue('border-style'); + }, + enumerable: true, + configurable: true +}; +var borderColor_export_isValid, borderColor_export_definition; + +borderColor_export_isValid = function parse(v) { + if (typeof v !== 'string') { + return false; + } + + return v === '' || v.toLowerCase() === 'transparent' || external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.COLOR; +}; + +var borderColor_local_var_isValid = borderColor_export_isValid; + +var borderColor_local_var_parser = function (v) { + if (borderColor_local_var_isValid(v)) { + return v.toLowerCase(); + } + + return undefined; +}; + +borderColor_export_definition = { + set: external_dependency_parsers_0.implicitSetter('border', 'color', borderColor_local_var_isValid, borderColor_local_var_parser), + get: function () { + return this.getPropertyValue('border-color'); + }, + enumerable: true, + configurable: true +}; +var border_export_isValid, border_export_definition; +var border_local_var_shorthand_for = { + 'border-width': { + isValid: borderWidth_export_isValid, + definition: borderWidth_export_definition + }, + 'border-style': { + isValid: borderStyle_export_isValid, + definition: borderStyle_export_definition + }, + 'border-color': { + isValid: borderColor_export_isValid, + definition: borderColor_export_definition + } +}; + +var border_local_var_isValid = function isValid(v) { + return external_dependency_parsers_0.shorthandParser(v, border_local_var_shorthand_for) !== undefined; +}; + +border_export_isValid = border_local_var_isValid; + +var border_local_var_parser = function (v) { + if (v.toString().toLowerCase() === 'none') { + v = ''; + } + + if (border_local_var_isValid(v)) { + return v; + } + + return undefined; +}; + +var border_local_var_myShorthandSetter = external_dependency_parsers_0.shorthandSetter('border', border_local_var_shorthand_for); +var border_local_var_myShorthandGetter = external_dependency_parsers_0.shorthandGetter('border', border_local_var_shorthand_for); +border_export_definition = { + set: function (v) { + if (v.toString().toLowerCase() === 'none') { + v = ''; + } + + border_local_var_myShorthandSetter.call(this, v); + this.removeProperty('border-top'); + this.removeProperty('border-left'); + this.removeProperty('border-right'); + this.removeProperty('border-bottom'); + this._values['border-top'] = this._values.border; + this._values['border-left'] = this._values.border; + this._values['border-right'] = this._values.border; + this._values['border-bottom'] = this._values.border; + }, + get: border_local_var_myShorthandGetter, + enumerable: true, + configurable: true +}; +var borderBottomWidth_export_isValid, borderBottomWidth_export_definition; +var borderBottomWidth_local_var_isValid = borderBottomWidth_export_isValid = borderWidth_export_isValid; +borderBottomWidth_export_definition = { + set: function (v) { + if (borderBottomWidth_local_var_isValid(v)) { + this._setProperty('border-bottom-width', v); + } + }, + get: function () { + return this.getPropertyValue('border-bottom-width'); + }, + enumerable: true, + configurable: true +}; +var borderBottomStyle_export_isValid, borderBottomStyle_export_definition; +borderBottomStyle_export_isValid = borderStyle_export_isValid; +borderBottomStyle_export_definition = { + set: function (v) { + if (borderStyle_export_isValid(v)) { + if (v.toLowerCase() === 'none') { + v = ''; + this.removeProperty('border-bottom-width'); + } + + this._setProperty('border-bottom-style', v); + } + }, + get: function () { + return this.getPropertyValue('border-bottom-style'); + }, + enumerable: true, + configurable: true +}; +var borderBottomColor_export_isValid, borderBottomColor_export_definition; +var borderBottomColor_local_var_isValid = borderBottomColor_export_isValid = borderColor_export_isValid; +borderBottomColor_export_definition = { + set: function (v) { + if (borderBottomColor_local_var_isValid(v)) { + this._setProperty('border-bottom-color', v); + } + }, + get: function () { + return this.getPropertyValue('border-bottom-color'); + }, + enumerable: true, + configurable: true +}; +var borderBottom_export_isValid, borderBottom_export_definition; +var borderBottom_local_var_shorthand_for = { + 'border-bottom-width': { + isValid: borderBottomWidth_export_isValid, + definition: borderBottomWidth_export_definition + }, + 'border-bottom-style': { + isValid: borderBottomStyle_export_isValid, + definition: borderBottomStyle_export_definition + }, + 'border-bottom-color': { + isValid: borderBottomColor_export_isValid, + definition: borderBottomColor_export_definition + } +}; + +var borderBottom_local_var_isValid = function isValid(v) { + return external_dependency_parsers_0.shorthandParser(v, borderBottom_local_var_shorthand_for) !== undefined; +}; + +borderBottom_export_isValid = borderBottom_local_var_isValid; +borderBottom_export_definition = { + set: external_dependency_parsers_0.shorthandSetter('border-bottom', borderBottom_local_var_shorthand_for), + get: external_dependency_parsers_0.shorthandGetter('border-bottom', borderBottom_local_var_shorthand_for), + enumerable: true, + configurable: true +}; +var borderBottomLeftRadius_export_definition; +borderBottomLeftRadius_export_definition = { + set: function (v) { + this._setProperty('border-bottom-left-radius', v); + }, + get: function () { + return this.getPropertyValue('border-bottom-left-radius'); + }, + enumerable: true, + configurable: true +}; +var borderBottomRightRadius_export_definition; +borderBottomRightRadius_export_definition = { + set: function (v) { + this._setProperty('border-bottom-right-radius', v); + }, + get: function () { + return this.getPropertyValue('border-bottom-right-radius'); + }, + enumerable: true, + configurable: true +}; +var borderCollapse_export_isValid, borderCollapse_export_definition; + +var borderCollapse_local_var_parse = function parse(v) { + if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && (v.toLowerCase() === 'collapse' || v.toLowerCase() === 'separate' || v.toLowerCase() === 'inherit')) { + return v; + } + + return undefined; +}; + +borderCollapse_export_isValid = function isValid(v) { + return borderCollapse_local_var_parse(v) !== undefined; +}; + +borderCollapse_export_definition = { + set: function (v) { + this._setProperty('border-collapse', borderCollapse_local_var_parse(v)); + }, + get: function () { + return this.getPropertyValue('border-collapse'); + }, + enumerable: true, + configurable: true +}; +var borderImage_export_definition; +borderImage_export_definition = { + set: function (v) { + this._setProperty('border-image', v); + }, + get: function () { + return this.getPropertyValue('border-image'); + }, + enumerable: true, + configurable: true +}; +var borderImageOutset_export_definition; +borderImageOutset_export_definition = { + set: function (v) { + this._setProperty('border-image-outset', v); + }, + get: function () { + return this.getPropertyValue('border-image-outset'); + }, + enumerable: true, + configurable: true +}; +var borderImageRepeat_export_definition; +borderImageRepeat_export_definition = { + set: function (v) { + this._setProperty('border-image-repeat', v); + }, + get: function () { + return this.getPropertyValue('border-image-repeat'); + }, + enumerable: true, + configurable: true +}; +var borderImageSlice_export_definition; +borderImageSlice_export_definition = { + set: function (v) { + this._setProperty('border-image-slice', v); + }, + get: function () { + return this.getPropertyValue('border-image-slice'); + }, + enumerable: true, + configurable: true +}; +var borderImageSource_export_definition; +borderImageSource_export_definition = { + set: function (v) { + this._setProperty('border-image-source', v); + }, + get: function () { + return this.getPropertyValue('border-image-source'); + }, + enumerable: true, + configurable: true +}; +var borderImageWidth_export_definition; +borderImageWidth_export_definition = { + set: function (v) { + this._setProperty('border-image-width', v); + }, + get: function () { + return this.getPropertyValue('border-image-width'); + }, + enumerable: true, + configurable: true +}; +var borderLeftWidth_export_isValid, borderLeftWidth_export_definition; +var borderLeftWidth_local_var_isValid = borderLeftWidth_export_isValid = borderWidth_export_isValid; +borderLeftWidth_export_definition = { + set: function (v) { + if (borderLeftWidth_local_var_isValid(v)) { + this._setProperty('border-left-width', v); + } + }, + get: function () { + return this.getPropertyValue('border-left-width'); + }, + enumerable: true, + configurable: true +}; +var borderLeftStyle_export_isValid, borderLeftStyle_export_definition; +borderLeftStyle_export_isValid = borderStyle_export_isValid; +borderLeftStyle_export_definition = { + set: function (v) { + if (borderStyle_export_isValid(v)) { + if (v.toLowerCase() === 'none') { + v = ''; + this.removeProperty('border-left-width'); + } + + this._setProperty('border-left-style', v); + } + }, + get: function () { + return this.getPropertyValue('border-left-style'); + }, + enumerable: true, + configurable: true +}; +var borderLeftColor_export_isValid, borderLeftColor_export_definition; +var borderLeftColor_local_var_isValid = borderLeftColor_export_isValid = borderColor_export_isValid; +borderLeftColor_export_definition = { + set: function (v) { + if (borderLeftColor_local_var_isValid(v)) { + this._setProperty('border-left-color', v); + } + }, + get: function () { + return this.getPropertyValue('border-left-color'); + }, + enumerable: true, + configurable: true +}; +var borderLeft_export_isValid, borderLeft_export_definition; +var borderLeft_local_var_shorthand_for = { + 'border-left-width': { + isValid: borderLeftWidth_export_isValid, + definition: borderLeftWidth_export_definition + }, + 'border-left-style': { + isValid: borderLeftStyle_export_isValid, + definition: borderLeftStyle_export_definition + }, + 'border-left-color': { + isValid: borderLeftColor_export_isValid, + definition: borderLeftColor_export_definition + } +}; + +var borderLeft_local_var_isValid = function isValid(v) { + return external_dependency_parsers_0.shorthandParser(v, borderLeft_local_var_shorthand_for) !== undefined; +}; + +borderLeft_export_isValid = borderLeft_local_var_isValid; +borderLeft_export_definition = { + set: external_dependency_parsers_0.shorthandSetter('border-left', borderLeft_local_var_shorthand_for), + get: external_dependency_parsers_0.shorthandGetter('border-left', borderLeft_local_var_shorthand_for), + enumerable: true, + configurable: true +}; +var borderRadius_export_definition; +borderRadius_export_definition = { + set: function (v) { + this._setProperty('border-radius', v); + }, + get: function () { + return this.getPropertyValue('border-radius'); + }, + enumerable: true, + configurable: true +}; +var borderRightWidth_export_isValid, borderRightWidth_export_definition; +var borderRightWidth_local_var_isValid = borderRightWidth_export_isValid = borderWidth_export_isValid; +borderRightWidth_export_definition = { + set: function (v) { + if (borderRightWidth_local_var_isValid(v)) { + this._setProperty('border-right-width', v); + } + }, + get: function () { + return this.getPropertyValue('border-right-width'); + }, + enumerable: true, + configurable: true +}; +var borderRightStyle_export_isValid, borderRightStyle_export_definition; +borderRightStyle_export_isValid = borderStyle_export_isValid; +borderRightStyle_export_definition = { + set: function (v) { + if (borderStyle_export_isValid(v)) { + if (v.toLowerCase() === 'none') { + v = ''; + this.removeProperty('border-right-width'); + } + + this._setProperty('border-right-style', v); + } + }, + get: function () { + return this.getPropertyValue('border-right-style'); + }, + enumerable: true, + configurable: true +}; +var borderRightColor_export_isValid, borderRightColor_export_definition; +var borderRightColor_local_var_isValid = borderRightColor_export_isValid = borderColor_export_isValid; +borderRightColor_export_definition = { + set: function (v) { + if (borderRightColor_local_var_isValid(v)) { + this._setProperty('border-right-color', v); + } + }, + get: function () { + return this.getPropertyValue('border-right-color'); + }, + enumerable: true, + configurable: true +}; +var borderRight_export_isValid, borderRight_export_definition; +var borderRight_local_var_shorthand_for = { + 'border-right-width': { + isValid: borderRightWidth_export_isValid, + definition: borderRightWidth_export_definition + }, + 'border-right-style': { + isValid: borderRightStyle_export_isValid, + definition: borderRightStyle_export_definition + }, + 'border-right-color': { + isValid: borderRightColor_export_isValid, + definition: borderRightColor_export_definition + } +}; + +var borderRight_local_var_isValid = function isValid(v) { + return external_dependency_parsers_0.shorthandParser(v, borderRight_local_var_shorthand_for) !== undefined; +}; + +borderRight_export_isValid = borderRight_local_var_isValid; +borderRight_export_definition = { + set: external_dependency_parsers_0.shorthandSetter('border-right', borderRight_local_var_shorthand_for), + get: external_dependency_parsers_0.shorthandGetter('border-right', borderRight_local_var_shorthand_for), + enumerable: true, + configurable: true +}; +var borderSpacing_export_isValid, borderSpacing_export_definition; + +// ? | inherit +// if one, it applies to both horizontal and verical spacing +// if two, the first applies to the horizontal and the second applies to vertical spacing +var borderSpacing_local_var_parse = function parse(v) { + if (v === '' || v === null) { + return undefined; + } + + if (v.toLowerCase() === 'inherit') { + return v; + } + + var parts = v.split(/\s+/); + + if (parts.length !== 1 && parts.length !== 2) { + return undefined; + } + + parts.forEach(function (part) { + if (external_dependency_parsers_0.valueType(part) !== external_dependency_parsers_0.TYPES.LENGTH) { + return undefined; + } + }); + return v; +}; + +borderSpacing_export_isValid = function isValid(v) { + return borderSpacing_local_var_parse(v) !== undefined; +}; + +borderSpacing_export_definition = { + set: function (v) { + this._setProperty('border-spacing', borderSpacing_local_var_parse(v)); + }, + get: function () { + return this.getPropertyValue('border-spacing'); + }, + enumerable: true, + configurable: true +}; +var borderTopWidth_export_isValid, borderTopWidth_export_definition; +borderTopWidth_export_isValid = borderWidth_export_isValid; +borderTopWidth_export_definition = { + set: function (v) { + if (borderWidth_export_isValid(v)) { + this._setProperty('border-top-width', v); + } + }, + get: function () { + return this.getPropertyValue('border-top-width'); + }, + enumerable: true, + configurable: true +}; +var borderTopStyle_export_isValid, borderTopStyle_export_definition; +borderTopStyle_export_isValid = borderStyle_export_isValid; +borderTopStyle_export_definition = { + set: function (v) { + if (borderStyle_export_isValid(v)) { + if (v.toLowerCase() === 'none') { + v = ''; + this.removeProperty('border-top-width'); + } + + this._setProperty('border-top-style', v); + } + }, + get: function () { + return this.getPropertyValue('border-top-style'); + }, + enumerable: true, + configurable: true +}; +var borderTopColor_export_isValid, borderTopColor_export_definition; +var borderTopColor_local_var_isValid = borderTopColor_export_isValid = borderColor_export_isValid; +borderTopColor_export_definition = { + set: function (v) { + if (borderTopColor_local_var_isValid(v)) { + this._setProperty('border-top-color', v); + } + }, + get: function () { + return this.getPropertyValue('border-top-color'); + }, + enumerable: true, + configurable: true +}; +var borderTop_export_isValid, borderTop_export_definition; +var borderTop_local_var_shorthand_for = { + 'border-top-width': { + isValid: borderTopWidth_export_isValid, + definition: borderTopWidth_export_definition + }, + 'border-top-style': { + isValid: borderTopStyle_export_isValid, + definition: borderTopStyle_export_definition + }, + 'border-top-color': { + isValid: borderTopColor_export_isValid, + definition: borderTopColor_export_definition + } +}; + +borderTop_export_isValid = function (v) { + return external_dependency_parsers_0.shorthandParser(v, borderTop_local_var_shorthand_for) !== undefined; +}; + +borderTop_export_definition = { + set: external_dependency_parsers_0.shorthandSetter('border-top', borderTop_local_var_shorthand_for), + get: external_dependency_parsers_0.shorthandGetter('border-top', borderTop_local_var_shorthand_for), + enumerable: true, + configurable: true +}; +var borderTopLeftRadius_export_definition; +borderTopLeftRadius_export_definition = { + set: function (v) { + this._setProperty('border-top-left-radius', v); + }, + get: function () { + return this.getPropertyValue('border-top-left-radius'); + }, + enumerable: true, + configurable: true +}; +var borderTopRightRadius_export_definition; +borderTopRightRadius_export_definition = { + set: function (v) { + this._setProperty('border-top-right-radius', v); + }, + get: function () { + return this.getPropertyValue('border-top-right-radius'); + }, + enumerable: true, + configurable: true +}; +var bottom_export_definition; +bottom_export_definition = { + set: function (v) { + this._setProperty('bottom', external_dependency_parsers_0.parseMeasurement(v)); + }, + get: function () { + return this.getPropertyValue('bottom'); + }, + enumerable: true, + configurable: true +}; +var boxShadow_export_definition; +boxShadow_export_definition = { + set: function (v) { + this._setProperty('box-shadow', v); + }, + get: function () { + return this.getPropertyValue('box-shadow'); + }, + enumerable: true, + configurable: true +}; +var boxSizing_export_definition; +boxSizing_export_definition = { + set: function (v) { + this._setProperty('box-sizing', v); + }, + get: function () { + return this.getPropertyValue('box-sizing'); + }, + enumerable: true, + configurable: true +}; +var captionSide_export_definition; +captionSide_export_definition = { + set: function (v) { + this._setProperty('caption-side', v); + }, + get: function () { + return this.getPropertyValue('caption-side'); + }, + enumerable: true, + configurable: true +}; +var clear_export_definition; +var clear_local_var_clear_keywords = ['none', 'left', 'right', 'both', 'inherit']; +clear_export_definition = { + set: function (v) { + this._setProperty('clear', external_dependency_parsers_0.parseKeyword(v, clear_local_var_clear_keywords)); + }, + get: function () { + return this.getPropertyValue('clear'); + }, + enumerable: true, + configurable: true +}; +var clip_export_definition; +/*jslint regexp: true*/var clip_local_var_shape_regex = /^rect\((.*)\)$/i; /*jslint regexp: false*/ + +var clip_local_var_parse = function (val) { + if (val === '' || val === null) { + return val; + } + + if (typeof val !== 'string') { + return undefined; + } + + val = val.toLowerCase(); + + if (val === 'auto' || val === 'inherit') { + return val; + } + + var matches = val.match(clip_local_var_shape_regex); + + if (!matches) { + return undefined; + } + + var parts = matches[1].split(/\s*,\s*/); + + if (parts.length !== 4) { + return undefined; + } + + var valid = parts.every(function (part, index) { + var measurement = external_dependency_parsers_0.parseMeasurement(part); + parts[index] = measurement; + return measurement !== undefined; + }); + + if (!valid) { + return undefined; + } + + parts = parts.join(', '); + return val.replace(matches[1], parts); +}; + +clip_export_definition = { + set: function (v) { + this._setProperty('clip', clip_local_var_parse(v)); + }, + get: function () { + return this.getPropertyValue('clip'); + }, + enumerable: true, + configurable: true +}; +var color_export_definition; +color_export_definition = { + set: function (v) { + this._setProperty('color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('color'); + }, + enumerable: true, + configurable: true +}; +var colorInterpolation_export_definition; +colorInterpolation_export_definition = { + set: function (v) { + this._setProperty('color-interpolation', v); + }, + get: function () { + return this.getPropertyValue('color-interpolation'); + }, + enumerable: true, + configurable: true +}; +var colorInterpolationFilters_export_definition; +colorInterpolationFilters_export_definition = { + set: function (v) { + this._setProperty('color-interpolation-filters', v); + }, + get: function () { + return this.getPropertyValue('color-interpolation-filters'); + }, + enumerable: true, + configurable: true +}; +var colorProfile_export_definition; +colorProfile_export_definition = { + set: function (v) { + this._setProperty('color-profile', v); + }, + get: function () { + return this.getPropertyValue('color-profile'); + }, + enumerable: true, + configurable: true +}; +var colorRendering_export_definition; +colorRendering_export_definition = { + set: function (v) { + this._setProperty('color-rendering', v); + }, + get: function () { + return this.getPropertyValue('color-rendering'); + }, + enumerable: true, + configurable: true +}; +var content_export_definition; +content_export_definition = { + set: function (v) { + this._setProperty('content', v); + }, + get: function () { + return this.getPropertyValue('content'); + }, + enumerable: true, + configurable: true +}; +var counterIncrement_export_definition; +counterIncrement_export_definition = { + set: function (v) { + this._setProperty('counter-increment', v); + }, + get: function () { + return this.getPropertyValue('counter-increment'); + }, + enumerable: true, + configurable: true +}; +var counterReset_export_definition; +counterReset_export_definition = { + set: function (v) { + this._setProperty('counter-reset', v); + }, + get: function () { + return this.getPropertyValue('counter-reset'); + }, + enumerable: true, + configurable: true +}; +var cssFloat_export_definition; +cssFloat_export_definition = { + set: function (v) { + this._setProperty('float', v); + }, + get: function () { + return this.getPropertyValue('float'); + }, + enumerable: true, + configurable: true +}; +var cue_export_definition; +cue_export_definition = { + set: function (v) { + this._setProperty('cue', v); + }, + get: function () { + return this.getPropertyValue('cue'); + }, + enumerable: true, + configurable: true +}; +var cueAfter_export_definition; +cueAfter_export_definition = { + set: function (v) { + this._setProperty('cue-after', v); + }, + get: function () { + return this.getPropertyValue('cue-after'); + }, + enumerable: true, + configurable: true +}; +var cueBefore_export_definition; +cueBefore_export_definition = { + set: function (v) { + this._setProperty('cue-before', v); + }, + get: function () { + return this.getPropertyValue('cue-before'); + }, + enumerable: true, + configurable: true +}; +var cursor_export_definition; +cursor_export_definition = { + set: function (v) { + this._setProperty('cursor', v); + }, + get: function () { + return this.getPropertyValue('cursor'); + }, + enumerable: true, + configurable: true +}; +var direction_export_definition; +direction_export_definition = { + set: function (v) { + this._setProperty('direction', v); + }, + get: function () { + return this.getPropertyValue('direction'); + }, + enumerable: true, + configurable: true +}; +var display_export_definition; +display_export_definition = { + set: function (v) { + this._setProperty('display', v); + }, + get: function () { + return this.getPropertyValue('display'); + }, + enumerable: true, + configurable: true +}; +var dominantBaseline_export_definition; +dominantBaseline_export_definition = { + set: function (v) { + this._setProperty('dominant-baseline', v); + }, + get: function () { + return this.getPropertyValue('dominant-baseline'); + }, + enumerable: true, + configurable: true +}; +var elevation_export_definition; +elevation_export_definition = { + set: function (v) { + this._setProperty('elevation', v); + }, + get: function () { + return this.getPropertyValue('elevation'); + }, + enumerable: true, + configurable: true +}; +var emptyCells_export_definition; +emptyCells_export_definition = { + set: function (v) { + this._setProperty('empty-cells', v); + }, + get: function () { + return this.getPropertyValue('empty-cells'); + }, + enumerable: true, + configurable: true +}; +var enableBackground_export_definition; +enableBackground_export_definition = { + set: function (v) { + this._setProperty('enable-background', v); + }, + get: function () { + return this.getPropertyValue('enable-background'); + }, + enumerable: true, + configurable: true +}; +var fill_export_definition; +fill_export_definition = { + set: function (v) { + this._setProperty('fill', v); + }, + get: function () { + return this.getPropertyValue('fill'); + }, + enumerable: true, + configurable: true +}; +var fillOpacity_export_definition; +fillOpacity_export_definition = { + set: function (v) { + this._setProperty('fill-opacity', v); + }, + get: function () { + return this.getPropertyValue('fill-opacity'); + }, + enumerable: true, + configurable: true +}; +var fillRule_export_definition; +fillRule_export_definition = { + set: function (v) { + this._setProperty('fill-rule', v); + }, + get: function () { + return this.getPropertyValue('fill-rule'); + }, + enumerable: true, + configurable: true +}; +var filter_export_definition; +filter_export_definition = { + set: function (v) { + this._setProperty('filter', v); + }, + get: function () { + return this.getPropertyValue('filter'); + }, + enumerable: true, + configurable: true +}; +var floodColor_export_definition; +floodColor_export_definition = { + set: function (v) { + this._setProperty('flood-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('flood-color'); + }, + enumerable: true, + configurable: true +}; +var floodOpacity_export_definition; +floodOpacity_export_definition = { + set: function (v) { + this._setProperty('flood-opacity', v); + }, + get: function () { + return this.getPropertyValue('flood-opacity'); + }, + enumerable: true, + configurable: true +}; +var fontFamily_export_isValid, fontFamily_export_definition; +var fontFamily_local_var_partsRegEx = /\s*,\s*/; + +fontFamily_export_isValid = function isValid(v) { + if (v === '' || v === null) { + return true; + } + + var parts = v.split(fontFamily_local_var_partsRegEx); + var len = parts.length; + var i; + var type; + + for (i = 0; i < len; i++) { + type = external_dependency_parsers_0.valueType(parts[i]); + + if (type === external_dependency_parsers_0.TYPES.STRING || type === external_dependency_parsers_0.TYPES.KEYWORD) { + return true; + } + } + + return false; +}; + +fontFamily_export_definition = { + set: function (v) { + this._setProperty('font-family', v); + }, + get: function () { + return this.getPropertyValue('font-family'); + }, + enumerable: true, + configurable: true +}; +var fontSize_export_isValid, fontSize_export_definition; +var fontSize_local_var_absoluteSizes = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large']; +var fontSize_local_var_relativeSizes = ['larger', 'smaller']; + +fontSize_export_isValid = function (v) { + var type = external_dependency_parsers_0.valueType(v.toLowerCase()); + return type === external_dependency_parsers_0.TYPES.LENGTH || type === external_dependency_parsers_0.TYPES.PERCENT || type === external_dependency_parsers_0.TYPES.KEYWORD && fontSize_local_var_absoluteSizes.indexOf(v.toLowerCase()) !== -1 || type === external_dependency_parsers_0.TYPES.KEYWORD && fontSize_local_var_relativeSizes.indexOf(v.toLowerCase()) !== -1; +}; + +fontSize_export_definition = { + set: function (v) { + this._setProperty('font-size', v); + }, + get: function () { + return this.getPropertyValue('font-size'); + }, + enumerable: true, + configurable: true +}; +var fontStyle_export_isValid, fontStyle_export_definition; +var fontStyle_local_var_valid_styles = ['normal', 'italic', 'oblique', 'inherit']; + +fontStyle_export_isValid = function (v) { + return fontStyle_local_var_valid_styles.indexOf(v.toLowerCase()) !== -1; +}; + +fontStyle_export_definition = { + set: function (v) { + this._setProperty('font-style', v); + }, + get: function () { + return this.getPropertyValue('font-style'); + }, + enumerable: true, + configurable: true +}; +var fontVariant_export_isValid, fontVariant_export_definition; +var fontVariant_local_var_valid_variants = ['normal', 'small-caps', 'inherit']; + +fontVariant_export_isValid = function isValid(v) { + return fontVariant_local_var_valid_variants.indexOf(v.toLowerCase()) !== -1; +}; + +fontVariant_export_definition = { + set: function (v) { + this._setProperty('font-variant', v); + }, + get: function () { + return this.getPropertyValue('font-variant'); + }, + enumerable: true, + configurable: true +}; +var fontWeight_export_isValid, fontWeight_export_definition; +var fontWeight_local_var_valid_weights = ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'inherit']; + +fontWeight_export_isValid = function isValid(v) { + return fontWeight_local_var_valid_weights.indexOf(v.toLowerCase()) !== -1; +}; + +fontWeight_export_definition = { + set: function (v) { + this._setProperty('font-weight', v); + }, + get: function () { + return this.getPropertyValue('font-weight'); + }, + enumerable: true, + configurable: true +}; +var lineHeight_export_isValid, lineHeight_export_definition; + +lineHeight_export_isValid = function isValid(v) { + var type = external_dependency_parsers_0.valueType(v); + return type === external_dependency_parsers_0.TYPES.KEYWORD && v.toLowerCase() === 'normal' || v.toLowerCase() === 'inherit' || type === external_dependency_parsers_0.TYPES.NUMBER || type === external_dependency_parsers_0.TYPES.LENGTH || type === external_dependency_parsers_0.TYPES.PERCENT; +}; + +lineHeight_export_definition = { + set: function (v) { + this._setProperty('line-height', v); + }, + get: function () { + return this.getPropertyValue('line-height'); + }, + enumerable: true, + configurable: true +}; +var font_export_isValid, font_export_definition; +var font_local_var_shorthand_for = { + 'font-family': { + isValid: fontFamily_export_isValid, + definition: fontFamily_export_definition + }, + 'font-size': { + isValid: fontSize_export_isValid, + definition: fontSize_export_definition + }, + 'font-style': { + isValid: fontStyle_export_isValid, + definition: fontStyle_export_definition + }, + 'font-variant': { + isValid: fontVariant_export_isValid, + definition: fontVariant_export_definition + }, + 'font-weight': { + isValid: fontWeight_export_isValid, + definition: fontWeight_export_definition + }, + 'line-height': { + isValid: lineHeight_export_isValid, + definition: lineHeight_export_definition + } +}; +var font_local_var_static_fonts = ['caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar', 'inherit']; + +font_export_isValid = function isValid(v) { + return external_dependency_parsers_0.shorthandParser(v, font_local_var_shorthand_for) !== undefined || external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && font_local_var_static_fonts.indexOf(v.toLowerCase()) !== -1; +}; + +var font_local_var_setter = external_dependency_parsers_0.shorthandSetter('font', font_local_var_shorthand_for); +font_export_definition = { + set: function (v) { + var short = external_dependency_parsers_0.shorthandParser(v, font_local_var_shorthand_for); + + if (short !== undefined) { + return font_local_var_setter.call(this, v); + } + + if (external_dependency_parsers_0.valueType(v) === external_dependency_parsers_0.TYPES.KEYWORD && font_local_var_static_fonts.indexOf(v.toLowerCase()) !== -1) { + this._setProperty('font', v); + } + }, + get: external_dependency_parsers_0.shorthandGetter('font', font_local_var_shorthand_for), + enumerable: true, + configurable: true +}; +var fontSizeAdjust_export_definition; +fontSizeAdjust_export_definition = { + set: function (v) { + this._setProperty('font-size-adjust', v); + }, + get: function () { + return this.getPropertyValue('font-size-adjust'); + }, + enumerable: true, + configurable: true +}; +var fontStretch_export_definition; +fontStretch_export_definition = { + set: function (v) { + this._setProperty('font-stretch', v); + }, + get: function () { + return this.getPropertyValue('font-stretch'); + }, + enumerable: true, + configurable: true +}; +var glyphOrientationHorizontal_export_definition; +glyphOrientationHorizontal_export_definition = { + set: function (v) { + this._setProperty('glyph-orientation-horizontal', v); + }, + get: function () { + return this.getPropertyValue('glyph-orientation-horizontal'); + }, + enumerable: true, + configurable: true +}; +var glyphOrientationVertical_export_definition; +glyphOrientationVertical_export_definition = { + set: function (v) { + this._setProperty('glyph-orientation-vertical', v); + }, + get: function () { + return this.getPropertyValue('glyph-orientation-vertical'); + }, + enumerable: true, + configurable: true +}; +var height_export_definition; + +function parse(v) { + if (String(v).toLowerCase() === 'auto') { + return 'auto'; + } + + if (String(v).toLowerCase() === 'inherit') { + return 'inherit'; + } + + return external_dependency_parsers_0.parseMeasurement(v); +} + +height_export_definition = { + set: function (v) { + this._setProperty('height', parse(v)); + }, + get: function () { + return this.getPropertyValue('height'); + }, + enumerable: true, + configurable: true +}; +var imageRendering_export_definition; +imageRendering_export_definition = { + set: function (v) { + this._setProperty('image-rendering', v); + }, + get: function () { + return this.getPropertyValue('image-rendering'); + }, + enumerable: true, + configurable: true +}; +var kerning_export_definition; +kerning_export_definition = { + set: function (v) { + this._setProperty('kerning', v); + }, + get: function () { + return this.getPropertyValue('kerning'); + }, + enumerable: true, + configurable: true +}; +var left_export_definition; +left_export_definition = { + set: function (v) { + this._setProperty('left', external_dependency_parsers_0.parseMeasurement(v)); + }, + get: function () { + return this.getPropertyValue('left'); + }, + enumerable: true, + configurable: true +}; +var letterSpacing_export_definition; +letterSpacing_export_definition = { + set: function (v) { + this._setProperty('letter-spacing', v); + }, + get: function () { + return this.getPropertyValue('letter-spacing'); + }, + enumerable: true, + configurable: true +}; +var lightingColor_export_definition; +lightingColor_export_definition = { + set: function (v) { + this._setProperty('lighting-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('lighting-color'); + }, + enumerable: true, + configurable: true +}; +var listStyle_export_definition; +listStyle_export_definition = { + set: function (v) { + this._setProperty('list-style', v); + }, + get: function () { + return this.getPropertyValue('list-style'); + }, + enumerable: true, + configurable: true +}; +var listStyleImage_export_definition; +listStyleImage_export_definition = { + set: function (v) { + this._setProperty('list-style-image', v); + }, + get: function () { + return this.getPropertyValue('list-style-image'); + }, + enumerable: true, + configurable: true +}; +var listStylePosition_export_definition; +listStylePosition_export_definition = { + set: function (v) { + this._setProperty('list-style-position', v); + }, + get: function () { + return this.getPropertyValue('list-style-position'); + }, + enumerable: true, + configurable: true +}; +var listStyleType_export_definition; +listStyleType_export_definition = { + set: function (v) { + this._setProperty('list-style-type', v); + }, + get: function () { + return this.getPropertyValue('list-style-type'); + }, + enumerable: true, + configurable: true +}; +var margin_export_definition, margin_export_isValid, margin_export_parser; +var margin_local_var_TYPES = external_dependency_parsers_0.TYPES; + +var margin_local_var_isValid = function (v) { + if (v.toLowerCase() === "auto") { + return true; + } + + var type = external_dependency_parsers_0.valueType(v); + return type === margin_local_var_TYPES.LENGTH || type === margin_local_var_TYPES.PERCENT || type === margin_local_var_TYPES.INTEGER && (v === '0' || v === 0); +}; + +var margin_local_var_parser = function (v) { + var V = v.toLowerCase(); + + if (V === "auto") { + return V; + } + + return external_dependency_parsers_0.parseMeasurement(v); +}; + +var margin_local_var_mySetter = external_dependency_parsers_0.implicitSetter('margin', '', margin_local_var_isValid, margin_local_var_parser); +var margin_local_var_myGlobal = external_dependency_parsers_0.implicitSetter('margin', '', function () { + return true; +}, function (v) { + return v; +}); +margin_export_definition = { + set: function (v) { + if (typeof v === "number") { + v = String(v); + } + + if (typeof v !== "string") { + return; + } + + var V = v.toLowerCase(); + + switch (V) { + case 'inherit': + case 'initial': + case 'unset': + case '': + margin_local_var_myGlobal.call(this, V); + break; + + default: + margin_local_var_mySetter.call(this, v); + break; + } + }, + get: function () { + return this.getPropertyValue('margin'); + }, + enumerable: true, + configurable: true +}; +margin_export_isValid = margin_local_var_isValid; +margin_export_parser = margin_local_var_parser; +var marginBottom_export_definition; +marginBottom_export_definition = { + set: external_dependency_parsers_0.subImplicitSetter('margin', 'bottom', { + definition: margin_export_definition, + isValid: margin_export_isValid, + parser: margin_export_parser + }.isValid, { + definition: margin_export_definition, + isValid: margin_export_isValid, + parser: margin_export_parser + }.parser), + get: function () { + return this.getPropertyValue('margin-bottom'); + }, + enumerable: true, + configurable: true +}; +var marginLeft_export_definition; +marginLeft_export_definition = { + set: external_dependency_parsers_0.subImplicitSetter('margin', 'left', { + definition: margin_export_definition, + isValid: margin_export_isValid, + parser: margin_export_parser + }.isValid, { + definition: margin_export_definition, + isValid: margin_export_isValid, + parser: margin_export_parser + }.parser), + get: function () { + return this.getPropertyValue('margin-left'); + }, + enumerable: true, + configurable: true +}; +var marginRight_export_definition; +marginRight_export_definition = { + set: external_dependency_parsers_0.subImplicitSetter('margin', 'right', { + definition: margin_export_definition, + isValid: margin_export_isValid, + parser: margin_export_parser + }.isValid, { + definition: margin_export_definition, + isValid: margin_export_isValid, + parser: margin_export_parser + }.parser), + get: function () { + return this.getPropertyValue('margin-right'); + }, + enumerable: true, + configurable: true +}; +var marginTop_export_definition; +marginTop_export_definition = { + set: external_dependency_parsers_0.subImplicitSetter('margin', 'top', { + definition: margin_export_definition, + isValid: margin_export_isValid, + parser: margin_export_parser + }.isValid, { + definition: margin_export_definition, + isValid: margin_export_isValid, + parser: margin_export_parser + }.parser), + get: function () { + return this.getPropertyValue('margin-top'); + }, + enumerable: true, + configurable: true +}; +var marker_export_definition; +marker_export_definition = { + set: function (v) { + this._setProperty('marker', v); + }, + get: function () { + return this.getPropertyValue('marker'); + }, + enumerable: true, + configurable: true +}; +var markerEnd_export_definition; +markerEnd_export_definition = { + set: function (v) { + this._setProperty('marker-end', v); + }, + get: function () { + return this.getPropertyValue('marker-end'); + }, + enumerable: true, + configurable: true +}; +var markerMid_export_definition; +markerMid_export_definition = { + set: function (v) { + this._setProperty('marker-mid', v); + }, + get: function () { + return this.getPropertyValue('marker-mid'); + }, + enumerable: true, + configurable: true +}; +var markerOffset_export_definition; +markerOffset_export_definition = { + set: function (v) { + this._setProperty('marker-offset', v); + }, + get: function () { + return this.getPropertyValue('marker-offset'); + }, + enumerable: true, + configurable: true +}; +var markerStart_export_definition; +markerStart_export_definition = { + set: function (v) { + this._setProperty('marker-start', v); + }, + get: function () { + return this.getPropertyValue('marker-start'); + }, + enumerable: true, + configurable: true +}; +var marks_export_definition; +marks_export_definition = { + set: function (v) { + this._setProperty('marks', v); + }, + get: function () { + return this.getPropertyValue('marks'); + }, + enumerable: true, + configurable: true +}; +var mask_export_definition; +mask_export_definition = { + set: function (v) { + this._setProperty('mask', v); + }, + get: function () { + return this.getPropertyValue('mask'); + }, + enumerable: true, + configurable: true +}; +var maxHeight_export_definition; +maxHeight_export_definition = { + set: function (v) { + this._setProperty('max-height', v); + }, + get: function () { + return this.getPropertyValue('max-height'); + }, + enumerable: true, + configurable: true +}; +var maxWidth_export_definition; +maxWidth_export_definition = { + set: function (v) { + this._setProperty('max-width', v); + }, + get: function () { + return this.getPropertyValue('max-width'); + }, + enumerable: true, + configurable: true +}; +var minHeight_export_definition; +minHeight_export_definition = { + set: function (v) { + this._setProperty('min-height', v); + }, + get: function () { + return this.getPropertyValue('min-height'); + }, + enumerable: true, + configurable: true +}; +var minWidth_export_definition; +minWidth_export_definition = { + set: function (v) { + this._setProperty('min-width', v); + }, + get: function () { + return this.getPropertyValue('min-width'); + }, + enumerable: true, + configurable: true +}; +var opacity_export_definition; +opacity_export_definition = { + set: function (v) { + this._setProperty('opacity', external_dependency_parsers_0.parseNumber(v)); + }, + get: function () { + return this.getPropertyValue('opacity'); + }, + enumerable: true, + configurable: true +}; +var orphans_export_definition; +orphans_export_definition = { + set: function (v) { + this._setProperty('orphans', v); + }, + get: function () { + return this.getPropertyValue('orphans'); + }, + enumerable: true, + configurable: true +}; +var outline_export_definition; +outline_export_definition = { + set: function (v) { + this._setProperty('outline', v); + }, + get: function () { + return this.getPropertyValue('outline'); + }, + enumerable: true, + configurable: true +}; +var outlineColor_export_definition; +outlineColor_export_definition = { + set: function (v) { + this._setProperty('outline-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('outline-color'); + }, + enumerable: true, + configurable: true +}; +var outlineOffset_export_definition; +outlineOffset_export_definition = { + set: function (v) { + this._setProperty('outline-offset', v); + }, + get: function () { + return this.getPropertyValue('outline-offset'); + }, + enumerable: true, + configurable: true +}; +var outlineStyle_export_definition; +outlineStyle_export_definition = { + set: function (v) { + this._setProperty('outline-style', v); + }, + get: function () { + return this.getPropertyValue('outline-style'); + }, + enumerable: true, + configurable: true +}; +var outlineWidth_export_definition; +outlineWidth_export_definition = { + set: function (v) { + this._setProperty('outline-width', v); + }, + get: function () { + return this.getPropertyValue('outline-width'); + }, + enumerable: true, + configurable: true +}; +var overflow_export_definition; +overflow_export_definition = { + set: function (v) { + this._setProperty('overflow', v); + }, + get: function () { + return this.getPropertyValue('overflow'); + }, + enumerable: true, + configurable: true +}; +var overflowX_export_definition; +overflowX_export_definition = { + set: function (v) { + this._setProperty('overflow-x', v); + }, + get: function () { + return this.getPropertyValue('overflow-x'); + }, + enumerable: true, + configurable: true +}; +var overflowY_export_definition; +overflowY_export_definition = { + set: function (v) { + this._setProperty('overflow-y', v); + }, + get: function () { + return this.getPropertyValue('overflow-y'); + }, + enumerable: true, + configurable: true +}; +var padding_export_definition, padding_export_isValid, padding_export_parser; +var padding_local_var_TYPES = external_dependency_parsers_0.TYPES; + +var padding_local_var_isValid = function (v) { + var type = external_dependency_parsers_0.valueType(v); + return type === padding_local_var_TYPES.LENGTH || type === padding_local_var_TYPES.PERCENT || type === padding_local_var_TYPES.INTEGER && (v === '0' || v === 0); +}; + +var padding_local_var_parser = function (v) { + return external_dependency_parsers_0.parseMeasurement(v); +}; + +var padding_local_var_mySetter = external_dependency_parsers_0.implicitSetter('padding', '', padding_local_var_isValid, padding_local_var_parser); +var padding_local_var_myGlobal = external_dependency_parsers_0.implicitSetter('padding', '', function () { + return true; +}, function (v) { + return v; +}); +padding_export_definition = { + set: function (v) { + if (typeof v === "number") { + v = String(v); + } + + if (typeof v !== "string") { + return; + } + + var V = v.toLowerCase(); + + switch (V) { + case 'inherit': + case 'initial': + case 'unset': + case '': + padding_local_var_myGlobal.call(this, V); + break; + + default: + padding_local_var_mySetter.call(this, v); + break; + } + }, + get: function () { + return this.getPropertyValue('padding'); + }, + enumerable: true, + configurable: true +}; +padding_export_isValid = padding_local_var_isValid; +padding_export_parser = padding_local_var_parser; +var paddingBottom_export_definition; +paddingBottom_export_definition = { + set: external_dependency_parsers_0.subImplicitSetter('padding', 'bottom', { + definition: padding_export_definition, + isValid: padding_export_isValid, + parser: padding_export_parser + }.isValid, { + definition: padding_export_definition, + isValid: padding_export_isValid, + parser: padding_export_parser + }.parser), + get: function () { + return this.getPropertyValue('padding-bottom'); + }, + enumerable: true, + configurable: true +}; +var paddingLeft_export_definition; +paddingLeft_export_definition = { + set: external_dependency_parsers_0.subImplicitSetter('padding', 'left', { + definition: padding_export_definition, + isValid: padding_export_isValid, + parser: padding_export_parser + }.isValid, { + definition: padding_export_definition, + isValid: padding_export_isValid, + parser: padding_export_parser + }.parser), + get: function () { + return this.getPropertyValue('padding-left'); + }, + enumerable: true, + configurable: true +}; +var paddingRight_export_definition; +paddingRight_export_definition = { + set: external_dependency_parsers_0.subImplicitSetter('padding', 'right', { + definition: padding_export_definition, + isValid: padding_export_isValid, + parser: padding_export_parser + }.isValid, { + definition: padding_export_definition, + isValid: padding_export_isValid, + parser: padding_export_parser + }.parser), + get: function () { + return this.getPropertyValue('padding-right'); + }, + enumerable: true, + configurable: true +}; +var paddingTop_export_definition; +paddingTop_export_definition = { + set: external_dependency_parsers_0.subImplicitSetter('padding', 'top', { + definition: padding_export_definition, + isValid: padding_export_isValid, + parser: padding_export_parser + }.isValid, { + definition: padding_export_definition, + isValid: padding_export_isValid, + parser: padding_export_parser + }.parser), + get: function () { + return this.getPropertyValue('padding-top'); + }, + enumerable: true, + configurable: true +}; +var page_export_definition; +page_export_definition = { + set: function (v) { + this._setProperty('page', v); + }, + get: function () { + return this.getPropertyValue('page'); + }, + enumerable: true, + configurable: true +}; +var pageBreakAfter_export_definition; +pageBreakAfter_export_definition = { + set: function (v) { + this._setProperty('page-break-after', v); + }, + get: function () { + return this.getPropertyValue('page-break-after'); + }, + enumerable: true, + configurable: true +}; +var pageBreakBefore_export_definition; +pageBreakBefore_export_definition = { + set: function (v) { + this._setProperty('page-break-before', v); + }, + get: function () { + return this.getPropertyValue('page-break-before'); + }, + enumerable: true, + configurable: true +}; +var pageBreakInside_export_definition; +pageBreakInside_export_definition = { + set: function (v) { + this._setProperty('page-break-inside', v); + }, + get: function () { + return this.getPropertyValue('page-break-inside'); + }, + enumerable: true, + configurable: true +}; +var pause_export_definition; +pause_export_definition = { + set: function (v) { + this._setProperty('pause', v); + }, + get: function () { + return this.getPropertyValue('pause'); + }, + enumerable: true, + configurable: true +}; +var pauseAfter_export_definition; +pauseAfter_export_definition = { + set: function (v) { + this._setProperty('pause-after', v); + }, + get: function () { + return this.getPropertyValue('pause-after'); + }, + enumerable: true, + configurable: true +}; +var pauseBefore_export_definition; +pauseBefore_export_definition = { + set: function (v) { + this._setProperty('pause-before', v); + }, + get: function () { + return this.getPropertyValue('pause-before'); + }, + enumerable: true, + configurable: true +}; +var pitch_export_definition; +pitch_export_definition = { + set: function (v) { + this._setProperty('pitch', v); + }, + get: function () { + return this.getPropertyValue('pitch'); + }, + enumerable: true, + configurable: true +}; +var pitchRange_export_definition; +pitchRange_export_definition = { + set: function (v) { + this._setProperty('pitch-range', v); + }, + get: function () { + return this.getPropertyValue('pitch-range'); + }, + enumerable: true, + configurable: true +}; +var playDuring_export_definition; +playDuring_export_definition = { + set: function (v) { + this._setProperty('play-during', v); + }, + get: function () { + return this.getPropertyValue('play-during'); + }, + enumerable: true, + configurable: true +}; +var pointerEvents_export_definition; +pointerEvents_export_definition = { + set: function (v) { + this._setProperty('pointer-events', v); + }, + get: function () { + return this.getPropertyValue('pointer-events'); + }, + enumerable: true, + configurable: true +}; +var position_export_definition; +position_export_definition = { + set: function (v) { + this._setProperty('position', v); + }, + get: function () { + return this.getPropertyValue('position'); + }, + enumerable: true, + configurable: true +}; +var quotes_export_definition; +quotes_export_definition = { + set: function (v) { + this._setProperty('quotes', v); + }, + get: function () { + return this.getPropertyValue('quotes'); + }, + enumerable: true, + configurable: true +}; +var resize_export_definition; +resize_export_definition = { + set: function (v) { + this._setProperty('resize', v); + }, + get: function () { + return this.getPropertyValue('resize'); + }, + enumerable: true, + configurable: true +}; +var richness_export_definition; +richness_export_definition = { + set: function (v) { + this._setProperty('richness', v); + }, + get: function () { + return this.getPropertyValue('richness'); + }, + enumerable: true, + configurable: true +}; +var right_export_definition; +right_export_definition = { + set: function (v) { + this._setProperty('right', external_dependency_parsers_0.parseMeasurement(v)); + }, + get: function () { + return this.getPropertyValue('right'); + }, + enumerable: true, + configurable: true +}; +var shapeRendering_export_definition; +shapeRendering_export_definition = { + set: function (v) { + this._setProperty('shape-rendering', v); + }, + get: function () { + return this.getPropertyValue('shape-rendering'); + }, + enumerable: true, + configurable: true +}; +var size_export_definition; +size_export_definition = { + set: function (v) { + this._setProperty('size', v); + }, + get: function () { + return this.getPropertyValue('size'); + }, + enumerable: true, + configurable: true +}; +var speak_export_definition; +speak_export_definition = { + set: function (v) { + this._setProperty('speak', v); + }, + get: function () { + return this.getPropertyValue('speak'); + }, + enumerable: true, + configurable: true +}; +var speakHeader_export_definition; +speakHeader_export_definition = { + set: function (v) { + this._setProperty('speak-header', v); + }, + get: function () { + return this.getPropertyValue('speak-header'); + }, + enumerable: true, + configurable: true +}; +var speakNumeral_export_definition; +speakNumeral_export_definition = { + set: function (v) { + this._setProperty('speak-numeral', v); + }, + get: function () { + return this.getPropertyValue('speak-numeral'); + }, + enumerable: true, + configurable: true +}; +var speakPunctuation_export_definition; +speakPunctuation_export_definition = { + set: function (v) { + this._setProperty('speak-punctuation', v); + }, + get: function () { + return this.getPropertyValue('speak-punctuation'); + }, + enumerable: true, + configurable: true +}; +var speechRate_export_definition; +speechRate_export_definition = { + set: function (v) { + this._setProperty('speech-rate', v); + }, + get: function () { + return this.getPropertyValue('speech-rate'); + }, + enumerable: true, + configurable: true +}; +var src_export_definition; +src_export_definition = { + set: function (v) { + this._setProperty('src', v); + }, + get: function () { + return this.getPropertyValue('src'); + }, + enumerable: true, + configurable: true +}; +var stopColor_export_definition; +stopColor_export_definition = { + set: function (v) { + this._setProperty('stop-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('stop-color'); + }, + enumerable: true, + configurable: true +}; +var stopOpacity_export_definition; +stopOpacity_export_definition = { + set: function (v) { + this._setProperty('stop-opacity', v); + }, + get: function () { + return this.getPropertyValue('stop-opacity'); + }, + enumerable: true, + configurable: true +}; +var stress_export_definition; +stress_export_definition = { + set: function (v) { + this._setProperty('stress', v); + }, + get: function () { + return this.getPropertyValue('stress'); + }, + enumerable: true, + configurable: true +}; +var stroke_export_definition; +stroke_export_definition = { + set: function (v) { + this._setProperty('stroke', v); + }, + get: function () { + return this.getPropertyValue('stroke'); + }, + enumerable: true, + configurable: true +}; +var strokeDasharray_export_definition; +strokeDasharray_export_definition = { + set: function (v) { + this._setProperty('stroke-dasharray', v); + }, + get: function () { + return this.getPropertyValue('stroke-dasharray'); + }, + enumerable: true, + configurable: true +}; +var strokeDashoffset_export_definition; +strokeDashoffset_export_definition = { + set: function (v) { + this._setProperty('stroke-dashoffset', v); + }, + get: function () { + return this.getPropertyValue('stroke-dashoffset'); + }, + enumerable: true, + configurable: true +}; +var strokeLinecap_export_definition; +strokeLinecap_export_definition = { + set: function (v) { + this._setProperty('stroke-linecap', v); + }, + get: function () { + return this.getPropertyValue('stroke-linecap'); + }, + enumerable: true, + configurable: true +}; +var strokeLinejoin_export_definition; +strokeLinejoin_export_definition = { + set: function (v) { + this._setProperty('stroke-linejoin', v); + }, + get: function () { + return this.getPropertyValue('stroke-linejoin'); + }, + enumerable: true, + configurable: true +}; +var strokeMiterlimit_export_definition; +strokeMiterlimit_export_definition = { + set: function (v) { + this._setProperty('stroke-miterlimit', v); + }, + get: function () { + return this.getPropertyValue('stroke-miterlimit'); + }, + enumerable: true, + configurable: true +}; +var strokeOpacity_export_definition; +strokeOpacity_export_definition = { + set: function (v) { + this._setProperty('stroke-opacity', v); + }, + get: function () { + return this.getPropertyValue('stroke-opacity'); + }, + enumerable: true, + configurable: true +}; +var strokeWidth_export_definition; +strokeWidth_export_definition = { + set: function (v) { + this._setProperty('stroke-width', v); + }, + get: function () { + return this.getPropertyValue('stroke-width'); + }, + enumerable: true, + configurable: true +}; +var tableLayout_export_definition; +tableLayout_export_definition = { + set: function (v) { + this._setProperty('table-layout', v); + }, + get: function () { + return this.getPropertyValue('table-layout'); + }, + enumerable: true, + configurable: true +}; +var textAlign_export_definition; +textAlign_export_definition = { + set: function (v) { + this._setProperty('text-align', v); + }, + get: function () { + return this.getPropertyValue('text-align'); + }, + enumerable: true, + configurable: true +}; +var textAnchor_export_definition; +textAnchor_export_definition = { + set: function (v) { + this._setProperty('text-anchor', v); + }, + get: function () { + return this.getPropertyValue('text-anchor'); + }, + enumerable: true, + configurable: true +}; +var textDecoration_export_definition; +textDecoration_export_definition = { + set: function (v) { + this._setProperty('text-decoration', v); + }, + get: function () { + return this.getPropertyValue('text-decoration'); + }, + enumerable: true, + configurable: true +}; +var textIndent_export_definition; +textIndent_export_definition = { + set: function (v) { + this._setProperty('text-indent', v); + }, + get: function () { + return this.getPropertyValue('text-indent'); + }, + enumerable: true, + configurable: true +}; +var textLineThrough_export_definition; +textLineThrough_export_definition = { + set: function (v) { + this._setProperty('text-line-through', v); + }, + get: function () { + return this.getPropertyValue('text-line-through'); + }, + enumerable: true, + configurable: true +}; +var textLineThroughColor_export_definition; +textLineThroughColor_export_definition = { + set: function (v) { + this._setProperty('text-line-through-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('text-line-through-color'); + }, + enumerable: true, + configurable: true +}; +var textLineThroughMode_export_definition; +textLineThroughMode_export_definition = { + set: function (v) { + this._setProperty('text-line-through-mode', v); + }, + get: function () { + return this.getPropertyValue('text-line-through-mode'); + }, + enumerable: true, + configurable: true +}; +var textLineThroughStyle_export_definition; +textLineThroughStyle_export_definition = { + set: function (v) { + this._setProperty('text-line-through-style', v); + }, + get: function () { + return this.getPropertyValue('text-line-through-style'); + }, + enumerable: true, + configurable: true +}; +var textLineThroughWidth_export_definition; +textLineThroughWidth_export_definition = { + set: function (v) { + this._setProperty('text-line-through-width', v); + }, + get: function () { + return this.getPropertyValue('text-line-through-width'); + }, + enumerable: true, + configurable: true +}; +var textOverflow_export_definition; +textOverflow_export_definition = { + set: function (v) { + this._setProperty('text-overflow', v); + }, + get: function () { + return this.getPropertyValue('text-overflow'); + }, + enumerable: true, + configurable: true +}; +var textOverline_export_definition; +textOverline_export_definition = { + set: function (v) { + this._setProperty('text-overline', v); + }, + get: function () { + return this.getPropertyValue('text-overline'); + }, + enumerable: true, + configurable: true +}; +var textOverlineColor_export_definition; +textOverlineColor_export_definition = { + set: function (v) { + this._setProperty('text-overline-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('text-overline-color'); + }, + enumerable: true, + configurable: true +}; +var textOverlineMode_export_definition; +textOverlineMode_export_definition = { + set: function (v) { + this._setProperty('text-overline-mode', v); + }, + get: function () { + return this.getPropertyValue('text-overline-mode'); + }, + enumerable: true, + configurable: true +}; +var textOverlineStyle_export_definition; +textOverlineStyle_export_definition = { + set: function (v) { + this._setProperty('text-overline-style', v); + }, + get: function () { + return this.getPropertyValue('text-overline-style'); + }, + enumerable: true, + configurable: true +}; +var textOverlineWidth_export_definition; +textOverlineWidth_export_definition = { + set: function (v) { + this._setProperty('text-overline-width', v); + }, + get: function () { + return this.getPropertyValue('text-overline-width'); + }, + enumerable: true, + configurable: true +}; +var textRendering_export_definition; +textRendering_export_definition = { + set: function (v) { + this._setProperty('text-rendering', v); + }, + get: function () { + return this.getPropertyValue('text-rendering'); + }, + enumerable: true, + configurable: true +}; +var textShadow_export_definition; +textShadow_export_definition = { + set: function (v) { + this._setProperty('text-shadow', v); + }, + get: function () { + return this.getPropertyValue('text-shadow'); + }, + enumerable: true, + configurable: true +}; +var textTransform_export_definition; +textTransform_export_definition = { + set: function (v) { + this._setProperty('text-transform', v); + }, + get: function () { + return this.getPropertyValue('text-transform'); + }, + enumerable: true, + configurable: true +}; +var textUnderline_export_definition; +textUnderline_export_definition = { + set: function (v) { + this._setProperty('text-underline', v); + }, + get: function () { + return this.getPropertyValue('text-underline'); + }, + enumerable: true, + configurable: true +}; +var textUnderlineColor_export_definition; +textUnderlineColor_export_definition = { + set: function (v) { + this._setProperty('text-underline-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('text-underline-color'); + }, + enumerable: true, + configurable: true +}; +var textUnderlineMode_export_definition; +textUnderlineMode_export_definition = { + set: function (v) { + this._setProperty('text-underline-mode', v); + }, + get: function () { + return this.getPropertyValue('text-underline-mode'); + }, + enumerable: true, + configurable: true +}; +var textUnderlineStyle_export_definition; +textUnderlineStyle_export_definition = { + set: function (v) { + this._setProperty('text-underline-style', v); + }, + get: function () { + return this.getPropertyValue('text-underline-style'); + }, + enumerable: true, + configurable: true +}; +var textUnderlineWidth_export_definition; +textUnderlineWidth_export_definition = { + set: function (v) { + this._setProperty('text-underline-width', v); + }, + get: function () { + return this.getPropertyValue('text-underline-width'); + }, + enumerable: true, + configurable: true +}; +var top_export_definition; +top_export_definition = { + set: function (v) { + this._setProperty('top', external_dependency_parsers_0.parseMeasurement(v)); + }, + get: function () { + return this.getPropertyValue('top'); + }, + enumerable: true, + configurable: true +}; +var unicodeBidi_export_definition; +unicodeBidi_export_definition = { + set: function (v) { + this._setProperty('unicode-bidi', v); + }, + get: function () { + return this.getPropertyValue('unicode-bidi'); + }, + enumerable: true, + configurable: true +}; +var unicodeRange_export_definition; +unicodeRange_export_definition = { + set: function (v) { + this._setProperty('unicode-range', v); + }, + get: function () { + return this.getPropertyValue('unicode-range'); + }, + enumerable: true, + configurable: true +}; +var vectorEffect_export_definition; +vectorEffect_export_definition = { + set: function (v) { + this._setProperty('vector-effect', v); + }, + get: function () { + return this.getPropertyValue('vector-effect'); + }, + enumerable: true, + configurable: true +}; +var verticalAlign_export_definition; +verticalAlign_export_definition = { + set: function (v) { + this._setProperty('vertical-align', v); + }, + get: function () { + return this.getPropertyValue('vertical-align'); + }, + enumerable: true, + configurable: true +}; +var visibility_export_definition; +visibility_export_definition = { + set: function (v) { + this._setProperty('visibility', v); + }, + get: function () { + return this.getPropertyValue('visibility'); + }, + enumerable: true, + configurable: true +}; +var voiceFamily_export_definition; +voiceFamily_export_definition = { + set: function (v) { + this._setProperty('voic-family', v); + }, + get: function () { + return this.getPropertyValue('voice-family'); + }, + enumerable: true, + configurable: true +}; +var volume_export_definition; +volume_export_definition = { + set: function (v) { + this._setProperty('volume', v); + }, + get: function () { + return this.getPropertyValue('volume'); + }, + enumerable: true, + configurable: true +}; +var webkitAnimation_export_definition; +webkitAnimation_export_definition = { + set: function (v) { + this._setProperty('-webkit-animation', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation'); + }, + enumerable: true, + configurable: true +}; +var webkitAnimationDelay_export_definition; +webkitAnimationDelay_export_definition = { + set: function (v) { + this._setProperty('-webkit-animation-delay', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-delay'); + }, + enumerable: true, + configurable: true +}; +var webkitAnimationDirection_export_definition; +webkitAnimationDirection_export_definition = { + set: function (v) { + this._setProperty('-webkit-animation-direction', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-direction'); + }, + enumerable: true, + configurable: true +}; +var webkitAnimationDuration_export_definition; +webkitAnimationDuration_export_definition = { + set: function (v) { + this._setProperty('-webkit-animation-duration', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-duration'); + }, + enumerable: true, + configurable: true +}; +var webkitAnimationFillMode_export_definition; +webkitAnimationFillMode_export_definition = { + set: function (v) { + this._setProperty('-webkit-animation-fill-mode', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-fill-mode'); + }, + enumerable: true, + configurable: true +}; +var webkitAnimationIterationCount_export_definition; +webkitAnimationIterationCount_export_definition = { + set: function (v) { + this._setProperty('-webkit-animation-iteration-count', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-iteration-count'); + }, + enumerable: true, + configurable: true +}; +var webkitAnimationName_export_definition; +webkitAnimationName_export_definition = { + set: function (v) { + this._setProperty('-webkit-animation-name', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-name'); + }, + enumerable: true, + configurable: true +}; +var webkitAnimationPlayState_export_definition; +webkitAnimationPlayState_export_definition = { + set: function (v) { + this._setProperty('-webkit-animation-play-state', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-play-state'); + }, + enumerable: true, + configurable: true +}; +var webkitAnimationTimingFunction_export_definition; +webkitAnimationTimingFunction_export_definition = { + set: function (v) { + this._setProperty('-webkit-animation-timing-function', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-timing-function'); + }, + enumerable: true, + configurable: true +}; +var webkitAppearance_export_definition; +webkitAppearance_export_definition = { + set: function (v) { + this._setProperty('-webkit-appearance', v); + }, + get: function () { + return this.getPropertyValue('-webkit-appearance'); + }, + enumerable: true, + configurable: true +}; +var webkitAspectRatio_export_definition; +webkitAspectRatio_export_definition = { + set: function (v) { + this._setProperty('-webkit-aspect-ratio', v); + }, + get: function () { + return this.getPropertyValue('-webkit-aspect-ratio'); + }, + enumerable: true, + configurable: true +}; +var webkitBackfaceVisibility_export_definition; +webkitBackfaceVisibility_export_definition = { + set: function (v) { + this._setProperty('-webkit-backface-visibility', v); + }, + get: function () { + return this.getPropertyValue('-webkit-backface-visibility'); + }, + enumerable: true, + configurable: true +}; +var webkitBackgroundClip_export_definition; +webkitBackgroundClip_export_definition = { + set: function (v) { + this._setProperty('-webkit-background-clip', v); + }, + get: function () { + return this.getPropertyValue('-webkit-background-clip'); + }, + enumerable: true, + configurable: true +}; +var webkitBackgroundComposite_export_definition; +webkitBackgroundComposite_export_definition = { + set: function (v) { + this._setProperty('-webkit-background-composite', v); + }, + get: function () { + return this.getPropertyValue('-webkit-background-composite'); + }, + enumerable: true, + configurable: true +}; +var webkitBackgroundOrigin_export_definition; +webkitBackgroundOrigin_export_definition = { + set: function (v) { + this._setProperty('-webkit-background-origin', v); + }, + get: function () { + return this.getPropertyValue('-webkit-background-origin'); + }, + enumerable: true, + configurable: true +}; +var webkitBackgroundSize_export_definition; +webkitBackgroundSize_export_definition = { + set: function (v) { + this._setProperty('-webkit-background-size', v); + }, + get: function () { + return this.getPropertyValue('-webkit-background-size'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderAfter_export_definition; +webkitBorderAfter_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-after'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderAfterColor_export_definition; +webkitBorderAfterColor_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-after-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-border-after-color'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderAfterStyle_export_definition; +webkitBorderAfterStyle_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-after-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-after-style'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderAfterWidth_export_definition; +webkitBorderAfterWidth_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-after-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-after-width'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderBefore_export_definition; +webkitBorderBefore_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-before'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderBeforeColor_export_definition; +webkitBorderBeforeColor_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-before-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-border-before-color'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderBeforeStyle_export_definition; +webkitBorderBeforeStyle_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-before-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-before-style'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderBeforeWidth_export_definition; +webkitBorderBeforeWidth_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-before-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-before-width'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderEnd_export_definition; +webkitBorderEnd_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-end', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-end'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderEndColor_export_definition; +webkitBorderEndColor_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-end-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-border-end-color'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderEndStyle_export_definition; +webkitBorderEndStyle_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-end-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-end-style'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderEndWidth_export_definition; +webkitBorderEndWidth_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-end-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-end-width'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderFit_export_definition; +webkitBorderFit_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-fit', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-fit'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderHorizontalSpacing_export_definition; +webkitBorderHorizontalSpacing_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-horizontal-spacing', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-horizontal-spacing'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderImage_export_definition; +webkitBorderImage_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-image', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-image'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderRadius_export_definition; +webkitBorderRadius_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-radius', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-radius'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderStart_export_definition; +webkitBorderStart_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-start', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-start'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderStartColor_export_definition; +webkitBorderStartColor_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-start-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-border-start-color'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderStartStyle_export_definition; +webkitBorderStartStyle_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-start-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-start-style'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderStartWidth_export_definition; +webkitBorderStartWidth_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-start-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-start-width'); + }, + enumerable: true, + configurable: true +}; +var webkitBorderVerticalSpacing_export_definition; +webkitBorderVerticalSpacing_export_definition = { + set: function (v) { + this._setProperty('-webkit-border-vertical-spacing', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-vertical-spacing'); + }, + enumerable: true, + configurable: true +}; +var webkitBoxAlign_export_definition; +webkitBoxAlign_export_definition = { + set: function (v) { + this._setProperty('-webkit-box-align', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-align'); + }, + enumerable: true, + configurable: true +}; +var webkitBoxDirection_export_definition; +webkitBoxDirection_export_definition = { + set: function (v) { + this._setProperty('-webkit-box-direction', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-direction'); + }, + enumerable: true, + configurable: true +}; +var webkitBoxFlex_export_definition; +webkitBoxFlex_export_definition = { + set: function (v) { + this._setProperty('-webkit-box-flex', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-flex'); + }, + enumerable: true, + configurable: true +}; +var webkitBoxFlexGroup_export_definition; +webkitBoxFlexGroup_export_definition = { + set: function (v) { + this._setProperty('-webkit-box-flex-group', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-flex-group'); + }, + enumerable: true, + configurable: true +}; +var webkitBoxLines_export_definition; +webkitBoxLines_export_definition = { + set: function (v) { + this._setProperty('-webkit-box-lines', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-lines'); + }, + enumerable: true, + configurable: true +}; +var webkitBoxOrdinalGroup_export_definition; +webkitBoxOrdinalGroup_export_definition = { + set: function (v) { + this._setProperty('-webkit-box-ordinal-group', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-ordinal-group'); + }, + enumerable: true, + configurable: true +}; +var webkitBoxOrient_export_definition; +webkitBoxOrient_export_definition = { + set: function (v) { + this._setProperty('-webkit-box-orient', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-orient'); + }, + enumerable: true, + configurable: true +}; +var webkitBoxPack_export_definition; +webkitBoxPack_export_definition = { + set: function (v) { + this._setProperty('-webkit-box-pack', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-pack'); + }, + enumerable: true, + configurable: true +}; +var webkitBoxReflect_export_definition; +webkitBoxReflect_export_definition = { + set: function (v) { + this._setProperty('-webkit-box-reflect', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-reflect'); + }, + enumerable: true, + configurable: true +}; +var webkitBoxShadow_export_definition; +webkitBoxShadow_export_definition = { + set: function (v) { + this._setProperty('-webkit-box-shadow', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-shadow'); + }, + enumerable: true, + configurable: true +}; +var webkitColorCorrection_export_definition; +webkitColorCorrection_export_definition = { + set: function (v) { + this._setProperty('-webkit-color-correction', v); + }, + get: function () { + return this.getPropertyValue('-webkit-color-correction'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnAxis_export_definition; +webkitColumnAxis_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-axis', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-axis'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnBreakAfter_export_definition; +webkitColumnBreakAfter_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-break-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-break-after'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnBreakBefore_export_definition; +webkitColumnBreakBefore_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-break-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-break-before'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnBreakInside_export_definition; +webkitColumnBreakInside_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-break-inside', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-break-inside'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnCount_export_definition; +webkitColumnCount_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-count', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-count'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnGap_export_definition; +webkitColumnGap_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-gap', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-gap'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnRule_export_definition; +webkitColumnRule_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-rule', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-rule'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnRuleColor_export_definition; +webkitColumnRuleColor_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-rule-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-column-rule-color'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnRuleStyle_export_definition; +webkitColumnRuleStyle_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-rule-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-rule-style'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnRuleWidth_export_definition; +webkitColumnRuleWidth_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-rule-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-rule-width'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnSpan_export_definition; +webkitColumnSpan_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-span', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-span'); + }, + enumerable: true, + configurable: true +}; +var webkitColumnWidth_export_definition; +webkitColumnWidth_export_definition = { + set: function (v) { + this._setProperty('-webkit-column-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-width'); + }, + enumerable: true, + configurable: true +}; +var webkitColumns_export_definition; +webkitColumns_export_definition = { + set: function (v) { + this._setProperty('-webkit-columns', v); + }, + get: function () { + return this.getPropertyValue('-webkit-columns'); + }, + enumerable: true, + configurable: true +}; +var webkitFilter_export_definition; +webkitFilter_export_definition = { + set: function (v) { + this._setProperty('-webkit-filter', v); + }, + get: function () { + return this.getPropertyValue('-webkit-filter'); + }, + enumerable: true, + configurable: true +}; +var webkitFlexAlign_export_definition; +webkitFlexAlign_export_definition = { + set: function (v) { + this._setProperty('-webkit-flex-align', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-align'); + }, + enumerable: true, + configurable: true +}; +var webkitFlexDirection_export_definition; +webkitFlexDirection_export_definition = { + set: function (v) { + this._setProperty('-webkit-flex-direction', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-direction'); + }, + enumerable: true, + configurable: true +}; +var webkitFlexFlow_export_definition; +webkitFlexFlow_export_definition = { + set: function (v) { + this._setProperty('-webkit-flex-flow', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-flow'); + }, + enumerable: true, + configurable: true +}; +var webkitFlexItemAlign_export_definition; +webkitFlexItemAlign_export_definition = { + set: function (v) { + this._setProperty('-webkit-flex-item-align', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-item-align'); + }, + enumerable: true, + configurable: true +}; +var webkitFlexLinePack_export_definition; +webkitFlexLinePack_export_definition = { + set: function (v) { + this._setProperty('-webkit-flex-line-pack', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-line-pack'); + }, + enumerable: true, + configurable: true +}; +var webkitFlexOrder_export_definition; +webkitFlexOrder_export_definition = { + set: function (v) { + this._setProperty('-webkit-flex-order', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-order'); + }, + enumerable: true, + configurable: true +}; +var webkitFlexPack_export_definition; +webkitFlexPack_export_definition = { + set: function (v) { + this._setProperty('-webkit-flex-pack', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-pack'); + }, + enumerable: true, + configurable: true +}; +var webkitFlexWrap_export_definition; +webkitFlexWrap_export_definition = { + set: function (v) { + this._setProperty('-webkit-flex-wrap', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-wrap'); + }, + enumerable: true, + configurable: true +}; +var webkitFlowFrom_export_definition; +webkitFlowFrom_export_definition = { + set: function (v) { + this._setProperty('-webkit-flow-from', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flow-from'); + }, + enumerable: true, + configurable: true +}; +var webkitFlowInto_export_definition; +webkitFlowInto_export_definition = { + set: function (v) { + this._setProperty('-webkit-flow-into', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flow-into'); + }, + enumerable: true, + configurable: true +}; +var webkitFontFeatureSettings_export_definition; +webkitFontFeatureSettings_export_definition = { + set: function (v) { + this._setProperty('-webkit-font-feature-settings', v); + }, + get: function () { + return this.getPropertyValue('-webkit-font-feature-settings'); + }, + enumerable: true, + configurable: true +}; +var webkitFontKerning_export_definition; +webkitFontKerning_export_definition = { + set: function (v) { + this._setProperty('-webkit-font-kerning', v); + }, + get: function () { + return this.getPropertyValue('-webkit-font-kerning'); + }, + enumerable: true, + configurable: true +}; +var webkitFontSizeDelta_export_definition; +webkitFontSizeDelta_export_definition = { + set: function (v) { + this._setProperty('-webkit-font-size-delta', v); + }, + get: function () { + return this.getPropertyValue('-webkit-font-size-delta'); + }, + enumerable: true, + configurable: true +}; +var webkitFontSmoothing_export_definition; +webkitFontSmoothing_export_definition = { + set: function (v) { + this._setProperty('-webkit-font-smoothing', v); + }, + get: function () { + return this.getPropertyValue('-webkit-font-smoothing'); + }, + enumerable: true, + configurable: true +}; +var webkitFontVariantLigatures_export_definition; +webkitFontVariantLigatures_export_definition = { + set: function (v) { + this._setProperty('-webkit-font-variant-ligatures', v); + }, + get: function () { + return this.getPropertyValue('-webkit-font-variant-ligatures'); + }, + enumerable: true, + configurable: true +}; +var webkitHighlight_export_definition; +webkitHighlight_export_definition = { + set: function (v) { + this._setProperty('-webkit-highlight', v); + }, + get: function () { + return this.getPropertyValue('-webkit-highlight'); + }, + enumerable: true, + configurable: true +}; +var webkitHyphenateCharacter_export_definition; +webkitHyphenateCharacter_export_definition = { + set: function (v) { + this._setProperty('-webkit-hyphenate-character', v); + }, + get: function () { + return this.getPropertyValue('-webkit-hyphenate-character'); + }, + enumerable: true, + configurable: true +}; +var webkitHyphenateLimitAfter_export_definition; +webkitHyphenateLimitAfter_export_definition = { + set: function (v) { + this._setProperty('-webkit-hyphenate-limit-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-hyphenate-limit-after'); + }, + enumerable: true, + configurable: true +}; +var webkitHyphenateLimitBefore_export_definition; +webkitHyphenateLimitBefore_export_definition = { + set: function (v) { + this._setProperty('-webkit-hyphenate-limit-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-hyphenate-limit-before'); + }, + enumerable: true, + configurable: true +}; +var webkitHyphenateLimitLines_export_definition; +webkitHyphenateLimitLines_export_definition = { + set: function (v) { + this._setProperty('-webkit-hyphenate-limit-lines', v); + }, + get: function () { + return this.getPropertyValue('-webkit-hyphenate-limit-lines'); + }, + enumerable: true, + configurable: true +}; +var webkitHyphens_export_definition; +webkitHyphens_export_definition = { + set: function (v) { + this._setProperty('-webkit-hyphens', v); + }, + get: function () { + return this.getPropertyValue('-webkit-hyphens'); + }, + enumerable: true, + configurable: true +}; +var webkitLineAlign_export_definition; +webkitLineAlign_export_definition = { + set: function (v) { + this._setProperty('-webkit-line-align', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-align'); + }, + enumerable: true, + configurable: true +}; +var webkitLineBoxContain_export_definition; +webkitLineBoxContain_export_definition = { + set: function (v) { + this._setProperty('-webkit-line-box-contain', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-box-contain'); + }, + enumerable: true, + configurable: true +}; +var webkitLineBreak_export_definition; +webkitLineBreak_export_definition = { + set: function (v) { + this._setProperty('-webkit-line-break', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-break'); + }, + enumerable: true, + configurable: true +}; +var webkitLineClamp_export_definition; +webkitLineClamp_export_definition = { + set: function (v) { + this._setProperty('-webkit-line-clamp', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-clamp'); + }, + enumerable: true, + configurable: true +}; +var webkitLineGrid_export_definition; +webkitLineGrid_export_definition = { + set: function (v) { + this._setProperty('-webkit-line-grid', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-grid'); + }, + enumerable: true, + configurable: true +}; +var webkitLineSnap_export_definition; +webkitLineSnap_export_definition = { + set: function (v) { + this._setProperty('-webkit-line-snap', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-snap'); + }, + enumerable: true, + configurable: true +}; +var webkitLocale_export_definition; +webkitLocale_export_definition = { + set: function (v) { + this._setProperty('-webkit-locale', v); + }, + get: function () { + return this.getPropertyValue('-webkit-locale'); + }, + enumerable: true, + configurable: true +}; +var webkitLogicalHeight_export_definition; +webkitLogicalHeight_export_definition = { + set: function (v) { + this._setProperty('-webkit-logical-height', v); + }, + get: function () { + return this.getPropertyValue('-webkit-logical-height'); + }, + enumerable: true, + configurable: true +}; +var webkitLogicalWidth_export_definition; +webkitLogicalWidth_export_definition = { + set: function (v) { + this._setProperty('-webkit-logical-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-logical-width'); + }, + enumerable: true, + configurable: true +}; +var webkitMarginAfter_export_definition; +webkitMarginAfter_export_definition = { + set: function (v) { + this._setProperty('-webkit-margin-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-after'); + }, + enumerable: true, + configurable: true +}; +var webkitMarginAfterCollapse_export_definition; +webkitMarginAfterCollapse_export_definition = { + set: function (v) { + this._setProperty('-webkit-margin-after-collapse', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-after-collapse'); + }, + enumerable: true, + configurable: true +}; +var webkitMarginBefore_export_definition; +webkitMarginBefore_export_definition = { + set: function (v) { + this._setProperty('-webkit-margin-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-before'); + }, + enumerable: true, + configurable: true +}; +var webkitMarginBeforeCollapse_export_definition; +webkitMarginBeforeCollapse_export_definition = { + set: function (v) { + this._setProperty('-webkit-margin-before-collapse', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-before-collapse'); + }, + enumerable: true, + configurable: true +}; +var webkitMarginBottomCollapse_export_definition; +webkitMarginBottomCollapse_export_definition = { + set: function (v) { + this._setProperty('-webkit-margin-bottom-collapse', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-bottom-collapse'); + }, + enumerable: true, + configurable: true +}; +var webkitMarginCollapse_export_definition; +webkitMarginCollapse_export_definition = { + set: function (v) { + this._setProperty('-webkit-margin-collapse', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-collapse'); + }, + enumerable: true, + configurable: true +}; +var webkitMarginEnd_export_definition; +webkitMarginEnd_export_definition = { + set: function (v) { + this._setProperty('-webkit-margin-end', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-end'); + }, + enumerable: true, + configurable: true +}; +var webkitMarginStart_export_definition; +webkitMarginStart_export_definition = { + set: function (v) { + this._setProperty('-webkit-margin-start', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-start'); + }, + enumerable: true, + configurable: true +}; +var webkitMarginTopCollapse_export_definition; +webkitMarginTopCollapse_export_definition = { + set: function (v) { + this._setProperty('-webkit-margin-top-collapse', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-top-collapse'); + }, + enumerable: true, + configurable: true +}; +var webkitMarquee_export_definition; +webkitMarquee_export_definition = { + set: function (v) { + this._setProperty('-webkit-marquee', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee'); + }, + enumerable: true, + configurable: true +}; +var webkitMarqueeDirection_export_definition; +webkitMarqueeDirection_export_definition = { + set: function (v) { + this._setProperty('-webkit-marquee-direction', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee-direction'); + }, + enumerable: true, + configurable: true +}; +var webkitMarqueeIncrement_export_definition; +webkitMarqueeIncrement_export_definition = { + set: function (v) { + this._setProperty('-webkit-marquee-increment', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee-increment'); + }, + enumerable: true, + configurable: true +}; +var webkitMarqueeRepetition_export_definition; +webkitMarqueeRepetition_export_definition = { + set: function (v) { + this._setProperty('-webkit-marquee-repetition', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee-repetition'); + }, + enumerable: true, + configurable: true +}; +var webkitMarqueeSpeed_export_definition; +webkitMarqueeSpeed_export_definition = { + set: function (v) { + this._setProperty('-webkit-marquee-speed', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee-speed'); + }, + enumerable: true, + configurable: true +}; +var webkitMarqueeStyle_export_definition; +webkitMarqueeStyle_export_definition = { + set: function (v) { + this._setProperty('-webkit-marquee-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee-style'); + }, + enumerable: true, + configurable: true +}; +var webkitMask_export_definition; +webkitMask_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskAttachment_export_definition; +webkitMaskAttachment_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-attachment', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-attachment'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskBoxImage_export_definition; +webkitMaskBoxImage_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskBoxImageOutset_export_definition; +webkitMaskBoxImageOutset_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image-outset', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image-outset'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskBoxImageRepeat_export_definition; +webkitMaskBoxImageRepeat_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image-repeat', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image-repeat'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskBoxImageSlice_export_definition; +webkitMaskBoxImageSlice_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image-slice', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image-slice'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskBoxImageSource_export_definition; +webkitMaskBoxImageSource_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image-source', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image-source'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskBoxImageWidth_export_definition; +webkitMaskBoxImageWidth_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image-width'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskClip_export_definition; +webkitMaskClip_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-clip', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-clip'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskComposite_export_definition; +webkitMaskComposite_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-composite', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-composite'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskImage_export_definition; +webkitMaskImage_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-image', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-image'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskOrigin_export_definition; +webkitMaskOrigin_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-origin', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-origin'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskPosition_export_definition; +webkitMaskPosition_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-position', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-position'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskPositionX_export_definition; +webkitMaskPositionX_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-position-x', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-position-x'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskPositionY_export_definition; +webkitMaskPositionY_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-position-y', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-position-y'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskRepeat_export_definition; +webkitMaskRepeat_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-repeat', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-repeat'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskRepeatX_export_definition; +webkitMaskRepeatX_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-repeat-x', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-repeat-x'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskRepeatY_export_definition; +webkitMaskRepeatY_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-repeat-y', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-repeat-y'); + }, + enumerable: true, + configurable: true +}; +var webkitMaskSize_export_definition; +webkitMaskSize_export_definition = { + set: function (v) { + this._setProperty('-webkit-mask-size', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-size'); + }, + enumerable: true, + configurable: true +}; +var webkitMatchNearestMailBlockquoteColor_export_definition; +webkitMatchNearestMailBlockquoteColor_export_definition = { + set: function (v) { + this._setProperty('-webkit-match-nearest-mail-blockquote-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-match-nearest-mail-blockquote-color'); + }, + enumerable: true, + configurable: true +}; +var webkitMaxLogicalHeight_export_definition; +webkitMaxLogicalHeight_export_definition = { + set: function (v) { + this._setProperty('-webkit-max-logical-height', v); + }, + get: function () { + return this.getPropertyValue('-webkit-max-logical-height'); + }, + enumerable: true, + configurable: true +}; +var webkitMaxLogicalWidth_export_definition; +webkitMaxLogicalWidth_export_definition = { + set: function (v) { + this._setProperty('-webkit-max-logical-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-max-logical-width'); + }, + enumerable: true, + configurable: true +}; +var webkitMinLogicalHeight_export_definition; +webkitMinLogicalHeight_export_definition = { + set: function (v) { + this._setProperty('-webkit-min-logical-height', v); + }, + get: function () { + return this.getPropertyValue('-webkit-min-logical-height'); + }, + enumerable: true, + configurable: true +}; +var webkitMinLogicalWidth_export_definition; +webkitMinLogicalWidth_export_definition = { + set: function (v) { + this._setProperty('-webkit-min-logical-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-min-logical-width'); + }, + enumerable: true, + configurable: true +}; +var webkitNbspMode_export_definition; +webkitNbspMode_export_definition = { + set: function (v) { + this._setProperty('-webkit-nbsp-mode', v); + }, + get: function () { + return this.getPropertyValue('-webkit-nbsp-mode'); + }, + enumerable: true, + configurable: true +}; +var webkitOverflowScrolling_export_definition; +webkitOverflowScrolling_export_definition = { + set: function (v) { + this._setProperty('-webkit-overflow-scrolling', v); + }, + get: function () { + return this.getPropertyValue('-webkit-overflow-scrolling'); + }, + enumerable: true, + configurable: true +}; +var webkitPaddingAfter_export_definition; +webkitPaddingAfter_export_definition = { + set: function (v) { + this._setProperty('-webkit-padding-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-padding-after'); + }, + enumerable: true, + configurable: true +}; +var webkitPaddingBefore_export_definition; +webkitPaddingBefore_export_definition = { + set: function (v) { + this._setProperty('-webkit-padding-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-padding-before'); + }, + enumerable: true, + configurable: true +}; +var webkitPaddingEnd_export_definition; +webkitPaddingEnd_export_definition = { + set: function (v) { + this._setProperty('-webkit-padding-end', v); + }, + get: function () { + return this.getPropertyValue('-webkit-padding-end'); + }, + enumerable: true, + configurable: true +}; +var webkitPaddingStart_export_definition; +webkitPaddingStart_export_definition = { + set: function (v) { + this._setProperty('-webkit-padding-start', v); + }, + get: function () { + return this.getPropertyValue('-webkit-padding-start'); + }, + enumerable: true, + configurable: true +}; +var webkitPerspective_export_definition; +webkitPerspective_export_definition = { + set: function (v) { + this._setProperty('-webkit-perspective', v); + }, + get: function () { + return this.getPropertyValue('-webkit-perspective'); + }, + enumerable: true, + configurable: true +}; +var webkitPerspectiveOrigin_export_definition; +webkitPerspectiveOrigin_export_definition = { + set: function (v) { + this._setProperty('-webkit-perspective-origin', v); + }, + get: function () { + return this.getPropertyValue('-webkit-perspective-origin'); + }, + enumerable: true, + configurable: true +}; +var webkitPerspectiveOriginX_export_definition; +webkitPerspectiveOriginX_export_definition = { + set: function (v) { + this._setProperty('-webkit-perspective-origin-x', v); + }, + get: function () { + return this.getPropertyValue('-webkit-perspective-origin-x'); + }, + enumerable: true, + configurable: true +}; +var webkitPerspectiveOriginY_export_definition; +webkitPerspectiveOriginY_export_definition = { + set: function (v) { + this._setProperty('-webkit-perspective-origin-y', v); + }, + get: function () { + return this.getPropertyValue('-webkit-perspective-origin-y'); + }, + enumerable: true, + configurable: true +}; +var webkitPrintColorAdjust_export_definition; +webkitPrintColorAdjust_export_definition = { + set: function (v) { + this._setProperty('-webkit-print-color-adjust', v); + }, + get: function () { + return this.getPropertyValue('-webkit-print-color-adjust'); + }, + enumerable: true, + configurable: true +}; +var webkitRegionBreakAfter_export_definition; +webkitRegionBreakAfter_export_definition = { + set: function (v) { + this._setProperty('-webkit-region-break-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-region-break-after'); + }, + enumerable: true, + configurable: true +}; +var webkitRegionBreakBefore_export_definition; +webkitRegionBreakBefore_export_definition = { + set: function (v) { + this._setProperty('-webkit-region-break-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-region-break-before'); + }, + enumerable: true, + configurable: true +}; +var webkitRegionBreakInside_export_definition; +webkitRegionBreakInside_export_definition = { + set: function (v) { + this._setProperty('-webkit-region-break-inside', v); + }, + get: function () { + return this.getPropertyValue('-webkit-region-break-inside'); + }, + enumerable: true, + configurable: true +}; +var webkitRegionOverflow_export_definition; +webkitRegionOverflow_export_definition = { + set: function (v) { + this._setProperty('-webkit-region-overflow', v); + }, + get: function () { + return this.getPropertyValue('-webkit-region-overflow'); + }, + enumerable: true, + configurable: true +}; +var webkitRtlOrdering_export_definition; +webkitRtlOrdering_export_definition = { + set: function (v) { + this._setProperty('-webkit-rtl-ordering', v); + }, + get: function () { + return this.getPropertyValue('-webkit-rtl-ordering'); + }, + enumerable: true, + configurable: true +}; +var webkitSvgShadow_export_definition; +webkitSvgShadow_export_definition = { + set: function (v) { + this._setProperty('-webkit-svg-shadow', v); + }, + get: function () { + return this.getPropertyValue('-webkit-svg-shadow'); + }, + enumerable: true, + configurable: true +}; +var webkitTapHighlightColor_export_definition; +webkitTapHighlightColor_export_definition = { + set: function (v) { + this._setProperty('-webkit-tap-highlight-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-tap-highlight-color'); + }, + enumerable: true, + configurable: true +}; +var webkitTextCombine_export_definition; +webkitTextCombine_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-combine', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-combine'); + }, + enumerable: true, + configurable: true +}; +var webkitTextDecorationsInEffect_export_definition; +webkitTextDecorationsInEffect_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-decorations-in-effect', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-decorations-in-effect'); + }, + enumerable: true, + configurable: true +}; +var webkitTextEmphasis_export_definition; +webkitTextEmphasis_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-emphasis', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-emphasis'); + }, + enumerable: true, + configurable: true +}; +var webkitTextEmphasisColor_export_definition; +webkitTextEmphasisColor_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-emphasis-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-text-emphasis-color'); + }, + enumerable: true, + configurable: true +}; +var webkitTextEmphasisPosition_export_definition; +webkitTextEmphasisPosition_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-emphasis-position', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-emphasis-position'); + }, + enumerable: true, + configurable: true +}; +var webkitTextEmphasisStyle_export_definition; +webkitTextEmphasisStyle_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-emphasis-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-emphasis-style'); + }, + enumerable: true, + configurable: true +}; +var webkitTextFillColor_export_definition; +webkitTextFillColor_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-fill-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-text-fill-color'); + }, + enumerable: true, + configurable: true +}; +var webkitTextOrientation_export_definition; +webkitTextOrientation_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-orientation', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-orientation'); + }, + enumerable: true, + configurable: true +}; +var webkitTextSecurity_export_definition; +webkitTextSecurity_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-security', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-security'); + }, + enumerable: true, + configurable: true +}; +var webkitTextSizeAdjust_export_definition; +webkitTextSizeAdjust_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-size-adjust', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-size-adjust'); + }, + enumerable: true, + configurable: true +}; +var webkitTextStroke_export_definition; +webkitTextStroke_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-stroke', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-stroke'); + }, + enumerable: true, + configurable: true +}; +var webkitTextStrokeColor_export_definition; +webkitTextStrokeColor_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-stroke-color', external_dependency_parsers_0.parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-text-stroke-color'); + }, + enumerable: true, + configurable: true +}; +var webkitTextStrokeWidth_export_definition; +webkitTextStrokeWidth_export_definition = { + set: function (v) { + this._setProperty('-webkit-text-stroke-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-stroke-width'); + }, + enumerable: true, + configurable: true +}; +var webkitTransform_export_definition; +webkitTransform_export_definition = { + set: function (v) { + this._setProperty('-webkit-transform', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform'); + }, + enumerable: true, + configurable: true +}; +var webkitTransformOrigin_export_definition; +webkitTransformOrigin_export_definition = { + set: function (v) { + this._setProperty('-webkit-transform-origin', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform-origin'); + }, + enumerable: true, + configurable: true +}; +var webkitTransformOriginX_export_definition; +webkitTransformOriginX_export_definition = { + set: function (v) { + this._setProperty('-webkit-transform-origin-x', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform-origin-x'); + }, + enumerable: true, + configurable: true +}; +var webkitTransformOriginY_export_definition; +webkitTransformOriginY_export_definition = { + set: function (v) { + this._setProperty('-webkit-transform-origin-y', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform-origin-y'); + }, + enumerable: true, + configurable: true +}; +var webkitTransformOriginZ_export_definition; +webkitTransformOriginZ_export_definition = { + set: function (v) { + this._setProperty('-webkit-transform-origin-z', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform-origin-z'); + }, + enumerable: true, + configurable: true +}; +var webkitTransformStyle_export_definition; +webkitTransformStyle_export_definition = { + set: function (v) { + this._setProperty('-webkit-transform-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform-style'); + }, + enumerable: true, + configurable: true +}; +var webkitTransition_export_definition; +webkitTransition_export_definition = { + set: function (v) { + this._setProperty('-webkit-transition', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transition'); + }, + enumerable: true, + configurable: true +}; +var webkitTransitionDelay_export_definition; +webkitTransitionDelay_export_definition = { + set: function (v) { + this._setProperty('-webkit-transition-delay', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transition-delay'); + }, + enumerable: true, + configurable: true +}; +var webkitTransitionDuration_export_definition; +webkitTransitionDuration_export_definition = { + set: function (v) { + this._setProperty('-webkit-transition-duration', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transition-duration'); + }, + enumerable: true, + configurable: true +}; +var webkitTransitionProperty_export_definition; +webkitTransitionProperty_export_definition = { + set: function (v) { + this._setProperty('-webkit-transition-property', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transition-property'); + }, + enumerable: true, + configurable: true +}; +var webkitTransitionTimingFunction_export_definition; +webkitTransitionTimingFunction_export_definition = { + set: function (v) { + this._setProperty('-webkit-transition-timing-function', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transition-timing-function'); + }, + enumerable: true, + configurable: true +}; +var webkitUserDrag_export_definition; +webkitUserDrag_export_definition = { + set: function (v) { + this._setProperty('-webkit-user-drag', v); + }, + get: function () { + return this.getPropertyValue('-webkit-user-drag'); + }, + enumerable: true, + configurable: true +}; +var webkitUserModify_export_definition; +webkitUserModify_export_definition = { + set: function (v) { + this._setProperty('-webkit-user-modify', v); + }, + get: function () { + return this.getPropertyValue('-webkit-user-modify'); + }, + enumerable: true, + configurable: true +}; +var webkitUserSelect_export_definition; +webkitUserSelect_export_definition = { + set: function (v) { + this._setProperty('-webkit-user-select', v); + }, + get: function () { + return this.getPropertyValue('-webkit-user-select'); + }, + enumerable: true, + configurable: true +}; +var webkitWrap_export_definition; +webkitWrap_export_definition = { + set: function (v) { + this._setProperty('-webkit-wrap', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap'); + }, + enumerable: true, + configurable: true +}; +var webkitWrapFlow_export_definition; +webkitWrapFlow_export_definition = { + set: function (v) { + this._setProperty('-webkit-wrap-flow', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-flow'); + }, + enumerable: true, + configurable: true +}; +var webkitWrapMargin_export_definition; +webkitWrapMargin_export_definition = { + set: function (v) { + this._setProperty('-webkit-wrap-margin', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-margin'); + }, + enumerable: true, + configurable: true +}; +var webkitWrapPadding_export_definition; +webkitWrapPadding_export_definition = { + set: function (v) { + this._setProperty('-webkit-wrap-padding', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-padding'); + }, + enumerable: true, + configurable: true +}; +var webkitWrapShapeInside_export_definition; +webkitWrapShapeInside_export_definition = { + set: function (v) { + this._setProperty('-webkit-wrap-shape-inside', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-shape-inside'); + }, + enumerable: true, + configurable: true +}; +var webkitWrapShapeOutside_export_definition; +webkitWrapShapeOutside_export_definition = { + set: function (v) { + this._setProperty('-webkit-wrap-shape-outside', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-shape-outside'); + }, + enumerable: true, + configurable: true +}; +var webkitWrapThrough_export_definition; +webkitWrapThrough_export_definition = { + set: function (v) { + this._setProperty('-webkit-wrap-through', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-through'); + }, + enumerable: true, + configurable: true +}; +var webkitWritingMode_export_definition; +webkitWritingMode_export_definition = { + set: function (v) { + this._setProperty('-webkit-writing-mode', v); + }, + get: function () { + return this.getPropertyValue('-webkit-writing-mode'); + }, + enumerable: true, + configurable: true +}; +var whiteSpace_export_definition; +whiteSpace_export_definition = { + set: function (v) { + this._setProperty('white-space', v); + }, + get: function () { + return this.getPropertyValue('white-space'); + }, + enumerable: true, + configurable: true +}; +var widows_export_definition; +widows_export_definition = { + set: function (v) { + this._setProperty('widows', v); + }, + get: function () { + return this.getPropertyValue('widows'); + }, + enumerable: true, + configurable: true +}; +var width_export_definition; + +function parse(v) { + if (String(v).toLowerCase() === 'auto') { + return 'auto'; + } + + if (String(v).toLowerCase() === 'inherit') { + return 'inherit'; + } + + return external_dependency_parsers_0.parseMeasurement(v); +} + +width_export_definition = { + set: function (v) { + this._setProperty('width', parse(v)); + }, + get: function () { + return this.getPropertyValue('width'); + }, + enumerable: true, + configurable: true +}; +var wordBreak_export_definition; +wordBreak_export_definition = { + set: function (v) { + this._setProperty('word-break', v); + }, + get: function () { + return this.getPropertyValue('word-break'); + }, + enumerable: true, + configurable: true +}; +var wordSpacing_export_definition; +wordSpacing_export_definition = { + set: function (v) { + this._setProperty('word-spacing', v); + }, + get: function () { + return this.getPropertyValue('word-spacing'); + }, + enumerable: true, + configurable: true +}; +var wordWrap_export_definition; +wordWrap_export_definition = { + set: function (v) { + this._setProperty('word-wrap', v); + }, + get: function () { + return this.getPropertyValue('word-wrap'); + }, + enumerable: true, + configurable: true +}; +var writingMode_export_definition; +writingMode_export_definition = { + set: function (v) { + this._setProperty('writing-mode', v); + }, + get: function () { + return this.getPropertyValue('writing-mode'); + }, + enumerable: true, + configurable: true +}; +var zIndex_export_definition; +zIndex_export_definition = { + set: function (v) { + this._setProperty('z-index', v); + }, + get: function () { + return this.getPropertyValue('z-index'); + }, + enumerable: true, + configurable: true +}; +var zoom_export_definition; +zoom_export_definition = { + set: function (v) { + this._setProperty('zoom', v); + }, + get: function () { + return this.getPropertyValue('zoom'); + }, + enumerable: true, + configurable: true +}; + +module.exports = function (prototype) { + Object.defineProperties(prototype, { + alignmentBaseline: alignmentBaseline_export_definition, + "alignment-baseline": alignmentBaseline_export_definition, + azimuth: azimuth_export_definition, + backgroundColor: backgroundColor_export_definition, + "background-color": backgroundColor_export_definition, + backgroundImage: backgroundImage_export_definition, + "background-image": backgroundImage_export_definition, + backgroundRepeat: backgroundRepeat_export_definition, + "background-repeat": backgroundRepeat_export_definition, + backgroundAttachment: backgroundAttachment_export_definition, + "background-attachment": backgroundAttachment_export_definition, + backgroundPosition: backgroundPosition_export_definition, + "background-position": backgroundPosition_export_definition, + background: background_export_definition, + backgroundClip: backgroundClip_export_definition, + "background-clip": backgroundClip_export_definition, + backgroundOrigin: backgroundOrigin_export_definition, + "background-origin": backgroundOrigin_export_definition, + backgroundPositionX: backgroundPositionX_export_definition, + "background-position-x": backgroundPositionX_export_definition, + backgroundPositionY: backgroundPositionY_export_definition, + "background-position-y": backgroundPositionY_export_definition, + backgroundRepeatX: backgroundRepeatX_export_definition, + "background-repeat-x": backgroundRepeatX_export_definition, + backgroundRepeatY: backgroundRepeatY_export_definition, + "background-repeat-y": backgroundRepeatY_export_definition, + backgroundSize: backgroundSize_export_definition, + "background-size": backgroundSize_export_definition, + baselineShift: baselineShift_export_definition, + "baseline-shift": baselineShift_export_definition, + borderWidth: borderWidth_export_definition, + "border-width": borderWidth_export_definition, + borderStyle: borderStyle_export_definition, + "border-style": borderStyle_export_definition, + borderColor: borderColor_export_definition, + "border-color": borderColor_export_definition, + border: border_export_definition, + borderBottomWidth: borderBottomWidth_export_definition, + "border-bottom-width": borderBottomWidth_export_definition, + borderBottomStyle: borderBottomStyle_export_definition, + "border-bottom-style": borderBottomStyle_export_definition, + borderBottomColor: borderBottomColor_export_definition, + "border-bottom-color": borderBottomColor_export_definition, + borderBottom: borderBottom_export_definition, + "border-bottom": borderBottom_export_definition, + borderBottomLeftRadius: borderBottomLeftRadius_export_definition, + "border-bottom-left-radius": borderBottomLeftRadius_export_definition, + borderBottomRightRadius: borderBottomRightRadius_export_definition, + "border-bottom-right-radius": borderBottomRightRadius_export_definition, + borderCollapse: borderCollapse_export_definition, + "border-collapse": borderCollapse_export_definition, + borderImage: borderImage_export_definition, + "border-image": borderImage_export_definition, + borderImageOutset: borderImageOutset_export_definition, + "border-image-outset": borderImageOutset_export_definition, + borderImageRepeat: borderImageRepeat_export_definition, + "border-image-repeat": borderImageRepeat_export_definition, + borderImageSlice: borderImageSlice_export_definition, + "border-image-slice": borderImageSlice_export_definition, + borderImageSource: borderImageSource_export_definition, + "border-image-source": borderImageSource_export_definition, + borderImageWidth: borderImageWidth_export_definition, + "border-image-width": borderImageWidth_export_definition, + borderLeftWidth: borderLeftWidth_export_definition, + "border-left-width": borderLeftWidth_export_definition, + borderLeftStyle: borderLeftStyle_export_definition, + "border-left-style": borderLeftStyle_export_definition, + borderLeftColor: borderLeftColor_export_definition, + "border-left-color": borderLeftColor_export_definition, + borderLeft: borderLeft_export_definition, + "border-left": borderLeft_export_definition, + borderRadius: borderRadius_export_definition, + "border-radius": borderRadius_export_definition, + borderRightWidth: borderRightWidth_export_definition, + "border-right-width": borderRightWidth_export_definition, + borderRightStyle: borderRightStyle_export_definition, + "border-right-style": borderRightStyle_export_definition, + borderRightColor: borderRightColor_export_definition, + "border-right-color": borderRightColor_export_definition, + borderRight: borderRight_export_definition, + "border-right": borderRight_export_definition, + borderSpacing: borderSpacing_export_definition, + "border-spacing": borderSpacing_export_definition, + borderTopWidth: borderTopWidth_export_definition, + "border-top-width": borderTopWidth_export_definition, + borderTopStyle: borderTopStyle_export_definition, + "border-top-style": borderTopStyle_export_definition, + borderTopColor: borderTopColor_export_definition, + "border-top-color": borderTopColor_export_definition, + borderTop: borderTop_export_definition, + "border-top": borderTop_export_definition, + borderTopLeftRadius: borderTopLeftRadius_export_definition, + "border-top-left-radius": borderTopLeftRadius_export_definition, + borderTopRightRadius: borderTopRightRadius_export_definition, + "border-top-right-radius": borderTopRightRadius_export_definition, + bottom: bottom_export_definition, + boxShadow: boxShadow_export_definition, + "box-shadow": boxShadow_export_definition, + boxSizing: boxSizing_export_definition, + "box-sizing": boxSizing_export_definition, + captionSide: captionSide_export_definition, + "caption-side": captionSide_export_definition, + clear: clear_export_definition, + clip: clip_export_definition, + color: color_export_definition, + colorInterpolation: colorInterpolation_export_definition, + "color-interpolation": colorInterpolation_export_definition, + colorInterpolationFilters: colorInterpolationFilters_export_definition, + "color-interpolation-filters": colorInterpolationFilters_export_definition, + colorProfile: colorProfile_export_definition, + "color-profile": colorProfile_export_definition, + colorRendering: colorRendering_export_definition, + "color-rendering": colorRendering_export_definition, + content: content_export_definition, + counterIncrement: counterIncrement_export_definition, + "counter-increment": counterIncrement_export_definition, + counterReset: counterReset_export_definition, + "counter-reset": counterReset_export_definition, + cssFloat: cssFloat_export_definition, + "css-float": cssFloat_export_definition, + cue: cue_export_definition, + cueAfter: cueAfter_export_definition, + "cue-after": cueAfter_export_definition, + cueBefore: cueBefore_export_definition, + "cue-before": cueBefore_export_definition, + cursor: cursor_export_definition, + direction: direction_export_definition, + display: display_export_definition, + dominantBaseline: dominantBaseline_export_definition, + "dominant-baseline": dominantBaseline_export_definition, + elevation: elevation_export_definition, + emptyCells: emptyCells_export_definition, + "empty-cells": emptyCells_export_definition, + enableBackground: enableBackground_export_definition, + "enable-background": enableBackground_export_definition, + fill: fill_export_definition, + fillOpacity: fillOpacity_export_definition, + "fill-opacity": fillOpacity_export_definition, + fillRule: fillRule_export_definition, + "fill-rule": fillRule_export_definition, + filter: filter_export_definition, + floodColor: floodColor_export_definition, + "flood-color": floodColor_export_definition, + floodOpacity: floodOpacity_export_definition, + "flood-opacity": floodOpacity_export_definition, + fontFamily: fontFamily_export_definition, + "font-family": fontFamily_export_definition, + fontSize: fontSize_export_definition, + "font-size": fontSize_export_definition, + fontStyle: fontStyle_export_definition, + "font-style": fontStyle_export_definition, + fontVariant: fontVariant_export_definition, + "font-variant": fontVariant_export_definition, + fontWeight: fontWeight_export_definition, + "font-weight": fontWeight_export_definition, + lineHeight: lineHeight_export_definition, + "line-height": lineHeight_export_definition, + font: font_export_definition, + fontSizeAdjust: fontSizeAdjust_export_definition, + "font-size-adjust": fontSizeAdjust_export_definition, + fontStretch: fontStretch_export_definition, + "font-stretch": fontStretch_export_definition, + glyphOrientationHorizontal: glyphOrientationHorizontal_export_definition, + "glyph-orientation-horizontal": glyphOrientationHorizontal_export_definition, + glyphOrientationVertical: glyphOrientationVertical_export_definition, + "glyph-orientation-vertical": glyphOrientationVertical_export_definition, + height: height_export_definition, + imageRendering: imageRendering_export_definition, + "image-rendering": imageRendering_export_definition, + kerning: kerning_export_definition, + left: left_export_definition, + letterSpacing: letterSpacing_export_definition, + "letter-spacing": letterSpacing_export_definition, + lightingColor: lightingColor_export_definition, + "lighting-color": lightingColor_export_definition, + listStyle: listStyle_export_definition, + "list-style": listStyle_export_definition, + listStyleImage: listStyleImage_export_definition, + "list-style-image": listStyleImage_export_definition, + listStylePosition: listStylePosition_export_definition, + "list-style-position": listStylePosition_export_definition, + listStyleType: listStyleType_export_definition, + "list-style-type": listStyleType_export_definition, + margin: margin_export_definition, + marginBottom: marginBottom_export_definition, + "margin-bottom": marginBottom_export_definition, + marginLeft: marginLeft_export_definition, + "margin-left": marginLeft_export_definition, + marginRight: marginRight_export_definition, + "margin-right": marginRight_export_definition, + marginTop: marginTop_export_definition, + "margin-top": marginTop_export_definition, + marker: marker_export_definition, + markerEnd: markerEnd_export_definition, + "marker-end": markerEnd_export_definition, + markerMid: markerMid_export_definition, + "marker-mid": markerMid_export_definition, + markerOffset: markerOffset_export_definition, + "marker-offset": markerOffset_export_definition, + markerStart: markerStart_export_definition, + "marker-start": markerStart_export_definition, + marks: marks_export_definition, + mask: mask_export_definition, + maxHeight: maxHeight_export_definition, + "max-height": maxHeight_export_definition, + maxWidth: maxWidth_export_definition, + "max-width": maxWidth_export_definition, + minHeight: minHeight_export_definition, + "min-height": minHeight_export_definition, + minWidth: minWidth_export_definition, + "min-width": minWidth_export_definition, + opacity: opacity_export_definition, + orphans: orphans_export_definition, + outline: outline_export_definition, + outlineColor: outlineColor_export_definition, + "outline-color": outlineColor_export_definition, + outlineOffset: outlineOffset_export_definition, + "outline-offset": outlineOffset_export_definition, + outlineStyle: outlineStyle_export_definition, + "outline-style": outlineStyle_export_definition, + outlineWidth: outlineWidth_export_definition, + "outline-width": outlineWidth_export_definition, + overflow: overflow_export_definition, + overflowX: overflowX_export_definition, + "overflow-x": overflowX_export_definition, + overflowY: overflowY_export_definition, + "overflow-y": overflowY_export_definition, + padding: padding_export_definition, + paddingBottom: paddingBottom_export_definition, + "padding-bottom": paddingBottom_export_definition, + paddingLeft: paddingLeft_export_definition, + "padding-left": paddingLeft_export_definition, + paddingRight: paddingRight_export_definition, + "padding-right": paddingRight_export_definition, + paddingTop: paddingTop_export_definition, + "padding-top": paddingTop_export_definition, + page: page_export_definition, + pageBreakAfter: pageBreakAfter_export_definition, + "page-break-after": pageBreakAfter_export_definition, + pageBreakBefore: pageBreakBefore_export_definition, + "page-break-before": pageBreakBefore_export_definition, + pageBreakInside: pageBreakInside_export_definition, + "page-break-inside": pageBreakInside_export_definition, + pause: pause_export_definition, + pauseAfter: pauseAfter_export_definition, + "pause-after": pauseAfter_export_definition, + pauseBefore: pauseBefore_export_definition, + "pause-before": pauseBefore_export_definition, + pitch: pitch_export_definition, + pitchRange: pitchRange_export_definition, + "pitch-range": pitchRange_export_definition, + playDuring: playDuring_export_definition, + "play-during": playDuring_export_definition, + pointerEvents: pointerEvents_export_definition, + "pointer-events": pointerEvents_export_definition, + position: position_export_definition, + quotes: quotes_export_definition, + resize: resize_export_definition, + richness: richness_export_definition, + right: right_export_definition, + shapeRendering: shapeRendering_export_definition, + "shape-rendering": shapeRendering_export_definition, + size: size_export_definition, + speak: speak_export_definition, + speakHeader: speakHeader_export_definition, + "speak-header": speakHeader_export_definition, + speakNumeral: speakNumeral_export_definition, + "speak-numeral": speakNumeral_export_definition, + speakPunctuation: speakPunctuation_export_definition, + "speak-punctuation": speakPunctuation_export_definition, + speechRate: speechRate_export_definition, + "speech-rate": speechRate_export_definition, + src: src_export_definition, + stopColor: stopColor_export_definition, + "stop-color": stopColor_export_definition, + stopOpacity: stopOpacity_export_definition, + "stop-opacity": stopOpacity_export_definition, + stress: stress_export_definition, + stroke: stroke_export_definition, + strokeDasharray: strokeDasharray_export_definition, + "stroke-dasharray": strokeDasharray_export_definition, + strokeDashoffset: strokeDashoffset_export_definition, + "stroke-dashoffset": strokeDashoffset_export_definition, + strokeLinecap: strokeLinecap_export_definition, + "stroke-linecap": strokeLinecap_export_definition, + strokeLinejoin: strokeLinejoin_export_definition, + "stroke-linejoin": strokeLinejoin_export_definition, + strokeMiterlimit: strokeMiterlimit_export_definition, + "stroke-miterlimit": strokeMiterlimit_export_definition, + strokeOpacity: strokeOpacity_export_definition, + "stroke-opacity": strokeOpacity_export_definition, + strokeWidth: strokeWidth_export_definition, + "stroke-width": strokeWidth_export_definition, + tableLayout: tableLayout_export_definition, + "table-layout": tableLayout_export_definition, + textAlign: textAlign_export_definition, + "text-align": textAlign_export_definition, + textAnchor: textAnchor_export_definition, + "text-anchor": textAnchor_export_definition, + textDecoration: textDecoration_export_definition, + "text-decoration": textDecoration_export_definition, + textIndent: textIndent_export_definition, + "text-indent": textIndent_export_definition, + textLineThrough: textLineThrough_export_definition, + "text-line-through": textLineThrough_export_definition, + textLineThroughColor: textLineThroughColor_export_definition, + "text-line-through-color": textLineThroughColor_export_definition, + textLineThroughMode: textLineThroughMode_export_definition, + "text-line-through-mode": textLineThroughMode_export_definition, + textLineThroughStyle: textLineThroughStyle_export_definition, + "text-line-through-style": textLineThroughStyle_export_definition, + textLineThroughWidth: textLineThroughWidth_export_definition, + "text-line-through-width": textLineThroughWidth_export_definition, + textOverflow: textOverflow_export_definition, + "text-overflow": textOverflow_export_definition, + textOverline: textOverline_export_definition, + "text-overline": textOverline_export_definition, + textOverlineColor: textOverlineColor_export_definition, + "text-overline-color": textOverlineColor_export_definition, + textOverlineMode: textOverlineMode_export_definition, + "text-overline-mode": textOverlineMode_export_definition, + textOverlineStyle: textOverlineStyle_export_definition, + "text-overline-style": textOverlineStyle_export_definition, + textOverlineWidth: textOverlineWidth_export_definition, + "text-overline-width": textOverlineWidth_export_definition, + textRendering: textRendering_export_definition, + "text-rendering": textRendering_export_definition, + textShadow: textShadow_export_definition, + "text-shadow": textShadow_export_definition, + textTransform: textTransform_export_definition, + "text-transform": textTransform_export_definition, + textUnderline: textUnderline_export_definition, + "text-underline": textUnderline_export_definition, + textUnderlineColor: textUnderlineColor_export_definition, + "text-underline-color": textUnderlineColor_export_definition, + textUnderlineMode: textUnderlineMode_export_definition, + "text-underline-mode": textUnderlineMode_export_definition, + textUnderlineStyle: textUnderlineStyle_export_definition, + "text-underline-style": textUnderlineStyle_export_definition, + textUnderlineWidth: textUnderlineWidth_export_definition, + "text-underline-width": textUnderlineWidth_export_definition, + top: top_export_definition, + unicodeBidi: unicodeBidi_export_definition, + "unicode-bidi": unicodeBidi_export_definition, + unicodeRange: unicodeRange_export_definition, + "unicode-range": unicodeRange_export_definition, + vectorEffect: vectorEffect_export_definition, + "vector-effect": vectorEffect_export_definition, + verticalAlign: verticalAlign_export_definition, + "vertical-align": verticalAlign_export_definition, + visibility: visibility_export_definition, + voiceFamily: voiceFamily_export_definition, + "voice-family": voiceFamily_export_definition, + volume: volume_export_definition, + webkitAnimation: webkitAnimation_export_definition, + "webkit-animation": webkitAnimation_export_definition, + webkitAnimationDelay: webkitAnimationDelay_export_definition, + "webkit-animation-delay": webkitAnimationDelay_export_definition, + webkitAnimationDirection: webkitAnimationDirection_export_definition, + "webkit-animation-direction": webkitAnimationDirection_export_definition, + webkitAnimationDuration: webkitAnimationDuration_export_definition, + "webkit-animation-duration": webkitAnimationDuration_export_definition, + webkitAnimationFillMode: webkitAnimationFillMode_export_definition, + "webkit-animation-fill-mode": webkitAnimationFillMode_export_definition, + webkitAnimationIterationCount: webkitAnimationIterationCount_export_definition, + "webkit-animation-iteration-count": webkitAnimationIterationCount_export_definition, + webkitAnimationName: webkitAnimationName_export_definition, + "webkit-animation-name": webkitAnimationName_export_definition, + webkitAnimationPlayState: webkitAnimationPlayState_export_definition, + "webkit-animation-play-state": webkitAnimationPlayState_export_definition, + webkitAnimationTimingFunction: webkitAnimationTimingFunction_export_definition, + "webkit-animation-timing-function": webkitAnimationTimingFunction_export_definition, + webkitAppearance: webkitAppearance_export_definition, + "webkit-appearance": webkitAppearance_export_definition, + webkitAspectRatio: webkitAspectRatio_export_definition, + "webkit-aspect-ratio": webkitAspectRatio_export_definition, + webkitBackfaceVisibility: webkitBackfaceVisibility_export_definition, + "webkit-backface-visibility": webkitBackfaceVisibility_export_definition, + webkitBackgroundClip: webkitBackgroundClip_export_definition, + "webkit-background-clip": webkitBackgroundClip_export_definition, + webkitBackgroundComposite: webkitBackgroundComposite_export_definition, + "webkit-background-composite": webkitBackgroundComposite_export_definition, + webkitBackgroundOrigin: webkitBackgroundOrigin_export_definition, + "webkit-background-origin": webkitBackgroundOrigin_export_definition, + webkitBackgroundSize: webkitBackgroundSize_export_definition, + "webkit-background-size": webkitBackgroundSize_export_definition, + webkitBorderAfter: webkitBorderAfter_export_definition, + "webkit-border-after": webkitBorderAfter_export_definition, + webkitBorderAfterColor: webkitBorderAfterColor_export_definition, + "webkit-border-after-color": webkitBorderAfterColor_export_definition, + webkitBorderAfterStyle: webkitBorderAfterStyle_export_definition, + "webkit-border-after-style": webkitBorderAfterStyle_export_definition, + webkitBorderAfterWidth: webkitBorderAfterWidth_export_definition, + "webkit-border-after-width": webkitBorderAfterWidth_export_definition, + webkitBorderBefore: webkitBorderBefore_export_definition, + "webkit-border-before": webkitBorderBefore_export_definition, + webkitBorderBeforeColor: webkitBorderBeforeColor_export_definition, + "webkit-border-before-color": webkitBorderBeforeColor_export_definition, + webkitBorderBeforeStyle: webkitBorderBeforeStyle_export_definition, + "webkit-border-before-style": webkitBorderBeforeStyle_export_definition, + webkitBorderBeforeWidth: webkitBorderBeforeWidth_export_definition, + "webkit-border-before-width": webkitBorderBeforeWidth_export_definition, + webkitBorderEnd: webkitBorderEnd_export_definition, + "webkit-border-end": webkitBorderEnd_export_definition, + webkitBorderEndColor: webkitBorderEndColor_export_definition, + "webkit-border-end-color": webkitBorderEndColor_export_definition, + webkitBorderEndStyle: webkitBorderEndStyle_export_definition, + "webkit-border-end-style": webkitBorderEndStyle_export_definition, + webkitBorderEndWidth: webkitBorderEndWidth_export_definition, + "webkit-border-end-width": webkitBorderEndWidth_export_definition, + webkitBorderFit: webkitBorderFit_export_definition, + "webkit-border-fit": webkitBorderFit_export_definition, + webkitBorderHorizontalSpacing: webkitBorderHorizontalSpacing_export_definition, + "webkit-border-horizontal-spacing": webkitBorderHorizontalSpacing_export_definition, + webkitBorderImage: webkitBorderImage_export_definition, + "webkit-border-image": webkitBorderImage_export_definition, + webkitBorderRadius: webkitBorderRadius_export_definition, + "webkit-border-radius": webkitBorderRadius_export_definition, + webkitBorderStart: webkitBorderStart_export_definition, + "webkit-border-start": webkitBorderStart_export_definition, + webkitBorderStartColor: webkitBorderStartColor_export_definition, + "webkit-border-start-color": webkitBorderStartColor_export_definition, + webkitBorderStartStyle: webkitBorderStartStyle_export_definition, + "webkit-border-start-style": webkitBorderStartStyle_export_definition, + webkitBorderStartWidth: webkitBorderStartWidth_export_definition, + "webkit-border-start-width": webkitBorderStartWidth_export_definition, + webkitBorderVerticalSpacing: webkitBorderVerticalSpacing_export_definition, + "webkit-border-vertical-spacing": webkitBorderVerticalSpacing_export_definition, + webkitBoxAlign: webkitBoxAlign_export_definition, + "webkit-box-align": webkitBoxAlign_export_definition, + webkitBoxDirection: webkitBoxDirection_export_definition, + "webkit-box-direction": webkitBoxDirection_export_definition, + webkitBoxFlex: webkitBoxFlex_export_definition, + "webkit-box-flex": webkitBoxFlex_export_definition, + webkitBoxFlexGroup: webkitBoxFlexGroup_export_definition, + "webkit-box-flex-group": webkitBoxFlexGroup_export_definition, + webkitBoxLines: webkitBoxLines_export_definition, + "webkit-box-lines": webkitBoxLines_export_definition, + webkitBoxOrdinalGroup: webkitBoxOrdinalGroup_export_definition, + "webkit-box-ordinal-group": webkitBoxOrdinalGroup_export_definition, + webkitBoxOrient: webkitBoxOrient_export_definition, + "webkit-box-orient": webkitBoxOrient_export_definition, + webkitBoxPack: webkitBoxPack_export_definition, + "webkit-box-pack": webkitBoxPack_export_definition, + webkitBoxReflect: webkitBoxReflect_export_definition, + "webkit-box-reflect": webkitBoxReflect_export_definition, + webkitBoxShadow: webkitBoxShadow_export_definition, + "webkit-box-shadow": webkitBoxShadow_export_definition, + webkitColorCorrection: webkitColorCorrection_export_definition, + "webkit-color-correction": webkitColorCorrection_export_definition, + webkitColumnAxis: webkitColumnAxis_export_definition, + "webkit-column-axis": webkitColumnAxis_export_definition, + webkitColumnBreakAfter: webkitColumnBreakAfter_export_definition, + "webkit-column-break-after": webkitColumnBreakAfter_export_definition, + webkitColumnBreakBefore: webkitColumnBreakBefore_export_definition, + "webkit-column-break-before": webkitColumnBreakBefore_export_definition, + webkitColumnBreakInside: webkitColumnBreakInside_export_definition, + "webkit-column-break-inside": webkitColumnBreakInside_export_definition, + webkitColumnCount: webkitColumnCount_export_definition, + "webkit-column-count": webkitColumnCount_export_definition, + webkitColumnGap: webkitColumnGap_export_definition, + "webkit-column-gap": webkitColumnGap_export_definition, + webkitColumnRule: webkitColumnRule_export_definition, + "webkit-column-rule": webkitColumnRule_export_definition, + webkitColumnRuleColor: webkitColumnRuleColor_export_definition, + "webkit-column-rule-color": webkitColumnRuleColor_export_definition, + webkitColumnRuleStyle: webkitColumnRuleStyle_export_definition, + "webkit-column-rule-style": webkitColumnRuleStyle_export_definition, + webkitColumnRuleWidth: webkitColumnRuleWidth_export_definition, + "webkit-column-rule-width": webkitColumnRuleWidth_export_definition, + webkitColumnSpan: webkitColumnSpan_export_definition, + "webkit-column-span": webkitColumnSpan_export_definition, + webkitColumnWidth: webkitColumnWidth_export_definition, + "webkit-column-width": webkitColumnWidth_export_definition, + webkitColumns: webkitColumns_export_definition, + "webkit-columns": webkitColumns_export_definition, + webkitFilter: webkitFilter_export_definition, + "webkit-filter": webkitFilter_export_definition, + webkitFlexAlign: webkitFlexAlign_export_definition, + "webkit-flex-align": webkitFlexAlign_export_definition, + webkitFlexDirection: webkitFlexDirection_export_definition, + "webkit-flex-direction": webkitFlexDirection_export_definition, + webkitFlexFlow: webkitFlexFlow_export_definition, + "webkit-flex-flow": webkitFlexFlow_export_definition, + webkitFlexItemAlign: webkitFlexItemAlign_export_definition, + "webkit-flex-item-align": webkitFlexItemAlign_export_definition, + webkitFlexLinePack: webkitFlexLinePack_export_definition, + "webkit-flex-line-pack": webkitFlexLinePack_export_definition, + webkitFlexOrder: webkitFlexOrder_export_definition, + "webkit-flex-order": webkitFlexOrder_export_definition, + webkitFlexPack: webkitFlexPack_export_definition, + "webkit-flex-pack": webkitFlexPack_export_definition, + webkitFlexWrap: webkitFlexWrap_export_definition, + "webkit-flex-wrap": webkitFlexWrap_export_definition, + webkitFlowFrom: webkitFlowFrom_export_definition, + "webkit-flow-from": webkitFlowFrom_export_definition, + webkitFlowInto: webkitFlowInto_export_definition, + "webkit-flow-into": webkitFlowInto_export_definition, + webkitFontFeatureSettings: webkitFontFeatureSettings_export_definition, + "webkit-font-feature-settings": webkitFontFeatureSettings_export_definition, + webkitFontKerning: webkitFontKerning_export_definition, + "webkit-font-kerning": webkitFontKerning_export_definition, + webkitFontSizeDelta: webkitFontSizeDelta_export_definition, + "webkit-font-size-delta": webkitFontSizeDelta_export_definition, + webkitFontSmoothing: webkitFontSmoothing_export_definition, + "webkit-font-smoothing": webkitFontSmoothing_export_definition, + webkitFontVariantLigatures: webkitFontVariantLigatures_export_definition, + "webkit-font-variant-ligatures": webkitFontVariantLigatures_export_definition, + webkitHighlight: webkitHighlight_export_definition, + "webkit-highlight": webkitHighlight_export_definition, + webkitHyphenateCharacter: webkitHyphenateCharacter_export_definition, + "webkit-hyphenate-character": webkitHyphenateCharacter_export_definition, + webkitHyphenateLimitAfter: webkitHyphenateLimitAfter_export_definition, + "webkit-hyphenate-limit-after": webkitHyphenateLimitAfter_export_definition, + webkitHyphenateLimitBefore: webkitHyphenateLimitBefore_export_definition, + "webkit-hyphenate-limit-before": webkitHyphenateLimitBefore_export_definition, + webkitHyphenateLimitLines: webkitHyphenateLimitLines_export_definition, + "webkit-hyphenate-limit-lines": webkitHyphenateLimitLines_export_definition, + webkitHyphens: webkitHyphens_export_definition, + "webkit-hyphens": webkitHyphens_export_definition, + webkitLineAlign: webkitLineAlign_export_definition, + "webkit-line-align": webkitLineAlign_export_definition, + webkitLineBoxContain: webkitLineBoxContain_export_definition, + "webkit-line-box-contain": webkitLineBoxContain_export_definition, + webkitLineBreak: webkitLineBreak_export_definition, + "webkit-line-break": webkitLineBreak_export_definition, + webkitLineClamp: webkitLineClamp_export_definition, + "webkit-line-clamp": webkitLineClamp_export_definition, + webkitLineGrid: webkitLineGrid_export_definition, + "webkit-line-grid": webkitLineGrid_export_definition, + webkitLineSnap: webkitLineSnap_export_definition, + "webkit-line-snap": webkitLineSnap_export_definition, + webkitLocale: webkitLocale_export_definition, + "webkit-locale": webkitLocale_export_definition, + webkitLogicalHeight: webkitLogicalHeight_export_definition, + "webkit-logical-height": webkitLogicalHeight_export_definition, + webkitLogicalWidth: webkitLogicalWidth_export_definition, + "webkit-logical-width": webkitLogicalWidth_export_definition, + webkitMarginAfter: webkitMarginAfter_export_definition, + "webkit-margin-after": webkitMarginAfter_export_definition, + webkitMarginAfterCollapse: webkitMarginAfterCollapse_export_definition, + "webkit-margin-after-collapse": webkitMarginAfterCollapse_export_definition, + webkitMarginBefore: webkitMarginBefore_export_definition, + "webkit-margin-before": webkitMarginBefore_export_definition, + webkitMarginBeforeCollapse: webkitMarginBeforeCollapse_export_definition, + "webkit-margin-before-collapse": webkitMarginBeforeCollapse_export_definition, + webkitMarginBottomCollapse: webkitMarginBottomCollapse_export_definition, + "webkit-margin-bottom-collapse": webkitMarginBottomCollapse_export_definition, + webkitMarginCollapse: webkitMarginCollapse_export_definition, + "webkit-margin-collapse": webkitMarginCollapse_export_definition, + webkitMarginEnd: webkitMarginEnd_export_definition, + "webkit-margin-end": webkitMarginEnd_export_definition, + webkitMarginStart: webkitMarginStart_export_definition, + "webkit-margin-start": webkitMarginStart_export_definition, + webkitMarginTopCollapse: webkitMarginTopCollapse_export_definition, + "webkit-margin-top-collapse": webkitMarginTopCollapse_export_definition, + webkitMarquee: webkitMarquee_export_definition, + "webkit-marquee": webkitMarquee_export_definition, + webkitMarqueeDirection: webkitMarqueeDirection_export_definition, + "webkit-marquee-direction": webkitMarqueeDirection_export_definition, + webkitMarqueeIncrement: webkitMarqueeIncrement_export_definition, + "webkit-marquee-increment": webkitMarqueeIncrement_export_definition, + webkitMarqueeRepetition: webkitMarqueeRepetition_export_definition, + "webkit-marquee-repetition": webkitMarqueeRepetition_export_definition, + webkitMarqueeSpeed: webkitMarqueeSpeed_export_definition, + "webkit-marquee-speed": webkitMarqueeSpeed_export_definition, + webkitMarqueeStyle: webkitMarqueeStyle_export_definition, + "webkit-marquee-style": webkitMarqueeStyle_export_definition, + webkitMask: webkitMask_export_definition, + "webkit-mask": webkitMask_export_definition, + webkitMaskAttachment: webkitMaskAttachment_export_definition, + "webkit-mask-attachment": webkitMaskAttachment_export_definition, + webkitMaskBoxImage: webkitMaskBoxImage_export_definition, + "webkit-mask-box-image": webkitMaskBoxImage_export_definition, + webkitMaskBoxImageOutset: webkitMaskBoxImageOutset_export_definition, + "webkit-mask-box-image-outset": webkitMaskBoxImageOutset_export_definition, + webkitMaskBoxImageRepeat: webkitMaskBoxImageRepeat_export_definition, + "webkit-mask-box-image-repeat": webkitMaskBoxImageRepeat_export_definition, + webkitMaskBoxImageSlice: webkitMaskBoxImageSlice_export_definition, + "webkit-mask-box-image-slice": webkitMaskBoxImageSlice_export_definition, + webkitMaskBoxImageSource: webkitMaskBoxImageSource_export_definition, + "webkit-mask-box-image-source": webkitMaskBoxImageSource_export_definition, + webkitMaskBoxImageWidth: webkitMaskBoxImageWidth_export_definition, + "webkit-mask-box-image-width": webkitMaskBoxImageWidth_export_definition, + webkitMaskClip: webkitMaskClip_export_definition, + "webkit-mask-clip": webkitMaskClip_export_definition, + webkitMaskComposite: webkitMaskComposite_export_definition, + "webkit-mask-composite": webkitMaskComposite_export_definition, + webkitMaskImage: webkitMaskImage_export_definition, + "webkit-mask-image": webkitMaskImage_export_definition, + webkitMaskOrigin: webkitMaskOrigin_export_definition, + "webkit-mask-origin": webkitMaskOrigin_export_definition, + webkitMaskPosition: webkitMaskPosition_export_definition, + "webkit-mask-position": webkitMaskPosition_export_definition, + webkitMaskPositionX: webkitMaskPositionX_export_definition, + "webkit-mask-position-x": webkitMaskPositionX_export_definition, + webkitMaskPositionY: webkitMaskPositionY_export_definition, + "webkit-mask-position-y": webkitMaskPositionY_export_definition, + webkitMaskRepeat: webkitMaskRepeat_export_definition, + "webkit-mask-repeat": webkitMaskRepeat_export_definition, + webkitMaskRepeatX: webkitMaskRepeatX_export_definition, + "webkit-mask-repeat-x": webkitMaskRepeatX_export_definition, + webkitMaskRepeatY: webkitMaskRepeatY_export_definition, + "webkit-mask-repeat-y": webkitMaskRepeatY_export_definition, + webkitMaskSize: webkitMaskSize_export_definition, + "webkit-mask-size": webkitMaskSize_export_definition, + webkitMatchNearestMailBlockquoteColor: webkitMatchNearestMailBlockquoteColor_export_definition, + "webkit-match-nearest-mail-blockquote-color": webkitMatchNearestMailBlockquoteColor_export_definition, + webkitMaxLogicalHeight: webkitMaxLogicalHeight_export_definition, + "webkit-max-logical-height": webkitMaxLogicalHeight_export_definition, + webkitMaxLogicalWidth: webkitMaxLogicalWidth_export_definition, + "webkit-max-logical-width": webkitMaxLogicalWidth_export_definition, + webkitMinLogicalHeight: webkitMinLogicalHeight_export_definition, + "webkit-min-logical-height": webkitMinLogicalHeight_export_definition, + webkitMinLogicalWidth: webkitMinLogicalWidth_export_definition, + "webkit-min-logical-width": webkitMinLogicalWidth_export_definition, + webkitNbspMode: webkitNbspMode_export_definition, + "webkit-nbsp-mode": webkitNbspMode_export_definition, + webkitOverflowScrolling: webkitOverflowScrolling_export_definition, + "webkit-overflow-scrolling": webkitOverflowScrolling_export_definition, + webkitPaddingAfter: webkitPaddingAfter_export_definition, + "webkit-padding-after": webkitPaddingAfter_export_definition, + webkitPaddingBefore: webkitPaddingBefore_export_definition, + "webkit-padding-before": webkitPaddingBefore_export_definition, + webkitPaddingEnd: webkitPaddingEnd_export_definition, + "webkit-padding-end": webkitPaddingEnd_export_definition, + webkitPaddingStart: webkitPaddingStart_export_definition, + "webkit-padding-start": webkitPaddingStart_export_definition, + webkitPerspective: webkitPerspective_export_definition, + "webkit-perspective": webkitPerspective_export_definition, + webkitPerspectiveOrigin: webkitPerspectiveOrigin_export_definition, + "webkit-perspective-origin": webkitPerspectiveOrigin_export_definition, + webkitPerspectiveOriginX: webkitPerspectiveOriginX_export_definition, + "webkit-perspective-origin-x": webkitPerspectiveOriginX_export_definition, + webkitPerspectiveOriginY: webkitPerspectiveOriginY_export_definition, + "webkit-perspective-origin-y": webkitPerspectiveOriginY_export_definition, + webkitPrintColorAdjust: webkitPrintColorAdjust_export_definition, + "webkit-print-color-adjust": webkitPrintColorAdjust_export_definition, + webkitRegionBreakAfter: webkitRegionBreakAfter_export_definition, + "webkit-region-break-after": webkitRegionBreakAfter_export_definition, + webkitRegionBreakBefore: webkitRegionBreakBefore_export_definition, + "webkit-region-break-before": webkitRegionBreakBefore_export_definition, + webkitRegionBreakInside: webkitRegionBreakInside_export_definition, + "webkit-region-break-inside": webkitRegionBreakInside_export_definition, + webkitRegionOverflow: webkitRegionOverflow_export_definition, + "webkit-region-overflow": webkitRegionOverflow_export_definition, + webkitRtlOrdering: webkitRtlOrdering_export_definition, + "webkit-rtl-ordering": webkitRtlOrdering_export_definition, + webkitSvgShadow: webkitSvgShadow_export_definition, + "webkit-svg-shadow": webkitSvgShadow_export_definition, + webkitTapHighlightColor: webkitTapHighlightColor_export_definition, + "webkit-tap-highlight-color": webkitTapHighlightColor_export_definition, + webkitTextCombine: webkitTextCombine_export_definition, + "webkit-text-combine": webkitTextCombine_export_definition, + webkitTextDecorationsInEffect: webkitTextDecorationsInEffect_export_definition, + "webkit-text-decorations-in-effect": webkitTextDecorationsInEffect_export_definition, + webkitTextEmphasis: webkitTextEmphasis_export_definition, + "webkit-text-emphasis": webkitTextEmphasis_export_definition, + webkitTextEmphasisColor: webkitTextEmphasisColor_export_definition, + "webkit-text-emphasis-color": webkitTextEmphasisColor_export_definition, + webkitTextEmphasisPosition: webkitTextEmphasisPosition_export_definition, + "webkit-text-emphasis-position": webkitTextEmphasisPosition_export_definition, + webkitTextEmphasisStyle: webkitTextEmphasisStyle_export_definition, + "webkit-text-emphasis-style": webkitTextEmphasisStyle_export_definition, + webkitTextFillColor: webkitTextFillColor_export_definition, + "webkit-text-fill-color": webkitTextFillColor_export_definition, + webkitTextOrientation: webkitTextOrientation_export_definition, + "webkit-text-orientation": webkitTextOrientation_export_definition, + webkitTextSecurity: webkitTextSecurity_export_definition, + "webkit-text-security": webkitTextSecurity_export_definition, + webkitTextSizeAdjust: webkitTextSizeAdjust_export_definition, + "webkit-text-size-adjust": webkitTextSizeAdjust_export_definition, + webkitTextStroke: webkitTextStroke_export_definition, + "webkit-text-stroke": webkitTextStroke_export_definition, + webkitTextStrokeColor: webkitTextStrokeColor_export_definition, + "webkit-text-stroke-color": webkitTextStrokeColor_export_definition, + webkitTextStrokeWidth: webkitTextStrokeWidth_export_definition, + "webkit-text-stroke-width": webkitTextStrokeWidth_export_definition, + webkitTransform: webkitTransform_export_definition, + "webkit-transform": webkitTransform_export_definition, + webkitTransformOrigin: webkitTransformOrigin_export_definition, + "webkit-transform-origin": webkitTransformOrigin_export_definition, + webkitTransformOriginX: webkitTransformOriginX_export_definition, + "webkit-transform-origin-x": webkitTransformOriginX_export_definition, + webkitTransformOriginY: webkitTransformOriginY_export_definition, + "webkit-transform-origin-y": webkitTransformOriginY_export_definition, + webkitTransformOriginZ: webkitTransformOriginZ_export_definition, + "webkit-transform-origin-z": webkitTransformOriginZ_export_definition, + webkitTransformStyle: webkitTransformStyle_export_definition, + "webkit-transform-style": webkitTransformStyle_export_definition, + webkitTransition: webkitTransition_export_definition, + "webkit-transition": webkitTransition_export_definition, + webkitTransitionDelay: webkitTransitionDelay_export_definition, + "webkit-transition-delay": webkitTransitionDelay_export_definition, + webkitTransitionDuration: webkitTransitionDuration_export_definition, + "webkit-transition-duration": webkitTransitionDuration_export_definition, + webkitTransitionProperty: webkitTransitionProperty_export_definition, + "webkit-transition-property": webkitTransitionProperty_export_definition, + webkitTransitionTimingFunction: webkitTransitionTimingFunction_export_definition, + "webkit-transition-timing-function": webkitTransitionTimingFunction_export_definition, + webkitUserDrag: webkitUserDrag_export_definition, + "webkit-user-drag": webkitUserDrag_export_definition, + webkitUserModify: webkitUserModify_export_definition, + "webkit-user-modify": webkitUserModify_export_definition, + webkitUserSelect: webkitUserSelect_export_definition, + "webkit-user-select": webkitUserSelect_export_definition, + webkitWrap: webkitWrap_export_definition, + "webkit-wrap": webkitWrap_export_definition, + webkitWrapFlow: webkitWrapFlow_export_definition, + "webkit-wrap-flow": webkitWrapFlow_export_definition, + webkitWrapMargin: webkitWrapMargin_export_definition, + "webkit-wrap-margin": webkitWrapMargin_export_definition, + webkitWrapPadding: webkitWrapPadding_export_definition, + "webkit-wrap-padding": webkitWrapPadding_export_definition, + webkitWrapShapeInside: webkitWrapShapeInside_export_definition, + "webkit-wrap-shape-inside": webkitWrapShapeInside_export_definition, + webkitWrapShapeOutside: webkitWrapShapeOutside_export_definition, + "webkit-wrap-shape-outside": webkitWrapShapeOutside_export_definition, + webkitWrapThrough: webkitWrapThrough_export_definition, + "webkit-wrap-through": webkitWrapThrough_export_definition, + webkitWritingMode: webkitWritingMode_export_definition, + "webkit-writing-mode": webkitWritingMode_export_definition, + whiteSpace: whiteSpace_export_definition, + "white-space": whiteSpace_export_definition, + widows: widows_export_definition, + width: width_export_definition, + wordBreak: wordBreak_export_definition, + "word-break": wordBreak_export_definition, + wordSpacing: wordSpacing_export_definition, + "word-spacing": wordSpacing_export_definition, + wordWrap: wordWrap_export_definition, + "word-wrap": wordWrap_export_definition, + writingMode: writingMode_export_definition, + "writing-mode": writingMode_export_definition, + zIndex: zIndex_export_definition, + "z-index": zIndex_export_definition, + zoom: zoom_export_definition + }); +}; diff --git a/node_modules/cssstyle/lib/properties/alignmentBaseline.js b/node_modules/cssstyle/lib/properties/alignmentBaseline.js new file mode 100644 index 0000000..c9a4963 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/alignmentBaseline.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('alignment-baseline', v); + }, + get: function () { + return this.getPropertyValue('alignment-baseline'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/azimuth.js b/node_modules/cssstyle/lib/properties/azimuth.js new file mode 100644 index 0000000..d48be84 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/azimuth.js @@ -0,0 +1,65 @@ +'use strict'; + +var parsers = require('../parsers'); + +module.exports.definition = { + set: function (v) { + var valueType = parsers.valueType(v); + if (valueType === parsers.TYPES.ANGLE) { + return this._setProperty('azimuth', parsers.parseAngle(v)); + } + if (valueType === parsers.TYPES.KEYWORD) { + var keywords = v.toLowerCase().trim().split(/\s+/); + var hasBehind = false; + if (keywords.length > 2) { + return; + } + var behindIndex = keywords.indexOf('behind'); + hasBehind = (behindIndex !== -1); + + if (keywords.length === 2) { + if (!hasBehind) { + return; + } + keywords.splice(behindIndex, 1); + } + if (keywords[0] === 'leftwards' || keywords[0] === 'rightwards') { + if (hasBehind) { + return; + } + return this._setProperty('azimuth', keywords[0]); + } + if (keywords[0] === 'behind') { + return this._setProperty('azimuth', '180deg'); + } + var deg; + switch (keywords[0]) { + case 'left-side': + return this._setProperty('azimuth', '270deg'); + case 'far-left': + return this._setProperty('azimuth', (hasBehind ? 240 : 300) + 'deg'); + case 'left': + return this._setProperty('azimuth', (hasBehind ? 220 : 320) + 'deg'); + case 'center-left': + return this._setProperty('azimuth', (hasBehind ? 200 : 340) + 'deg'); + case 'center': + return this._setProperty('azimuth', (hasBehind ? 180 : 0) + 'deg'); + case 'center-right': + return this._setProperty('azimuth', (hasBehind ? 160 : 20) + 'deg'); + case 'right': + return this._setProperty('azimuth', (hasBehind ? 140 : 40) + 'deg'); + case 'far-right': + return this._setProperty('azimuth', (hasBehind ? 120 : 60) + 'deg'); + case 'right-side': + return this._setProperty('azimuth', '90deg'); + default: + return; + } + } + }, + get: function () { + return this.getPropertyValue('azimuth'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/background.js b/node_modules/cssstyle/lib/properties/background.js new file mode 100644 index 0000000..3f62c27 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/background.js @@ -0,0 +1,24 @@ +'use strict'; + +var shorthandParser = require('../parsers').shorthandParser; +var shorthandSetter = require('../parsers').shorthandSetter; +var shorthandGetter = require('../parsers').shorthandGetter; + +var shorthand_for = { + 'background-color': require('./backgroundColor'), + 'background-image': require('./backgroundImage'), + 'background-repeat': require('./backgroundRepeat'), + 'background-attachment': require('./backgroundAttachment'), + 'background-position': require('./backgroundPosition') +}; + +module.exports.isValid = function isValid(v) { + return shorthandParser(v, shorthand_for) !== undefined; +}; + +module.exports.definition = { + set: shorthandSetter('background', shorthand_for), + get: shorthandGetter('background', shorthand_for), + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundAttachment.js b/node_modules/cssstyle/lib/properties/backgroundAttachment.js new file mode 100644 index 0000000..3bcb1f1 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundAttachment.js @@ -0,0 +1,22 @@ +'use strict'; + +var parsers = require('../parsers'); + +var isValid = module.exports.isValid = function isValid(v) { + return parsers.valueType(v) === parsers.TYPES.KEYWORD && + (v.toLowerCase() === 'scroll' || v.toLowerCase() === 'fixed' || v.toLowerCase() === 'inherit'); +}; + +module.exports.definition = { + set: function (v) { + if (!isValid(v)) { + return; + } + this._setProperty('background-attachment', v); + }, + get: function () { + return this.getPropertyValue('background-attachment'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundClip.js b/node_modules/cssstyle/lib/properties/backgroundClip.js new file mode 100644 index 0000000..e7a1557 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundClip.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('background-clip', v); + }, + get: function () { + return this.getPropertyValue('background-clip'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundColor.js b/node_modules/cssstyle/lib/properties/backgroundColor.js new file mode 100644 index 0000000..994975a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundColor.js @@ -0,0 +1,33 @@ +'use strict'; + +var parsers = require('../parsers'); + +var parse = function parse(v) { + var parsed = parsers.parseColor(v); + if (parsed !== undefined) { + return parsed; + } + if (parsers.valueType(v) === parsers.TYPES.KEYWORD && (v.toLowerCase() === 'transparent' || v.toLowerCase() === 'inherit')) { + return v; + } + return undefined; +}; + +module.exports.isValid = function isValid(v) { + return parse(v) !== undefined; +}; + +module.exports.definition = { + set: function (v) { + var parsed = parse(v); + if (parsed === undefined) { + return; + } + this._setProperty('background-color', parsed); + }, + get: function () { + return this.getPropertyValue('background-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundImage.js b/node_modules/cssstyle/lib/properties/backgroundImage.js new file mode 100644 index 0000000..5bb79f9 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundImage.js @@ -0,0 +1,29 @@ +'use strict'; + +var parsers = require('../parsers'); + +var parse = function parse(v) { + var parsed = parsers.parseUrl(v); + if (parsed !== undefined) { + return parsed; + } + if (parsers.valueType(v) === parsers.TYPES.KEYWORD && (v.toLowerCase() === 'none' || v.toLowerCase() === 'inherit')) { + return v; + } + return undefined; +}; + +module.exports.isValid = function isValid(v) { + return parse(v) !== undefined; +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('background-image', parse(v)); + }, + get: function () { + return this.getPropertyValue('background-image'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundOrigin.js b/node_modules/cssstyle/lib/properties/backgroundOrigin.js new file mode 100644 index 0000000..79bfdc2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundOrigin.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('background-origin', v); + }, + get: function () { + return this.getPropertyValue('background-origin'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundPosition.js b/node_modules/cssstyle/lib/properties/backgroundPosition.js new file mode 100644 index 0000000..b4c78d7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundPosition.js @@ -0,0 +1,56 @@ +'use strict'; + +var parsers = require('../parsers'); + +var valid_keywords = ['top', 'center', 'bottom', 'left', 'right']; + +var parse = function parse(v) { + if (v === '' || v === null) { + return undefined; + } + var parts = v.split(/\s+/); + if (parts.length > 2 || parts.length < 1) { + return undefined; + } + var types = []; + parts.forEach(function (part, index) { + types[index] = parsers.valueType(part); + }); + if (parts.length === 1) { + if (types[0] === parsers.TYPES.LENGTH || types[0] === parsers.TYPES.PERCENT) { + return v; + } + if (types[0] === parsers.TYPES.KEYWORD) { + if (valid_keywords.indexOf(v.toLowerCase()) !== -1 || v.toLowerCase() === 'inherit') { + return v; + } + } + return undefined; + } + if ((types[0] === parsers.TYPES.LENGTH || types[0] === parsers.TYPES.PERCENT) && + (types[1] === parsers.TYPES.LENGTH || types[1] === parsers.TYPES.PERCENT)) { + return v; + } + if (types[0] !== parsers.TYPES.KEYWORD || types[1] !== parsers.TYPES.KEYWORD) { + return undefined; + } + if (valid_keywords.indexOf(parts[0]) !== -1 && valid_keywords.indexOf(parts[1]) !== -1) { + return v; + } + return undefined; +}; + +module.exports.isValid = function isValid(v) { + return parse(v) !== undefined; +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('background-position', parse(v)); + }, + get: function () { + return this.getPropertyValue('background-position'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundPositionX.js b/node_modules/cssstyle/lib/properties/backgroundPositionX.js new file mode 100644 index 0000000..8f0f7f0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundPositionX.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('background-position-x', v); + }, + get: function () { + return this.getPropertyValue('background-position-x'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundPositionY.js b/node_modules/cssstyle/lib/properties/backgroundPositionY.js new file mode 100644 index 0000000..3981d37 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundPositionY.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('background-position-y', v); + }, + get: function () { + return this.getPropertyValue('background-position-y'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundRepeat.js b/node_modules/cssstyle/lib/properties/backgroundRepeat.js new file mode 100644 index 0000000..765a06d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundRepeat.js @@ -0,0 +1,25 @@ +'use strict'; + +var parsers = require('../parsers'); + +var parse = function parse(v) { + if (parsers.valueType(v) === parsers.TYPES.KEYWORD && (v.toLowerCase() === 'repeat' || v.toLowerCase() === 'repeat-x' || v.toLowerCase() === 'repeat-y' || v.toLowerCase() === 'no-repeat' || v.toLowerCase() === 'inherit')) { + return v; + } + return undefined; +}; + +module.exports.isValid = function isValid(v) { + return parse(v) !== undefined; +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('background-repeat', parse(v)); + }, + get: function () { + return this.getPropertyValue('background-repeat'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundRepeatX.js b/node_modules/cssstyle/lib/properties/backgroundRepeatX.js new file mode 100644 index 0000000..ddc0fc8 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundRepeatX.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('background-repeat-x', v); + }, + get: function () { + return this.getPropertyValue('background-repeat-x'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundRepeatY.js b/node_modules/cssstyle/lib/properties/backgroundRepeatY.js new file mode 100644 index 0000000..583e0d7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundRepeatY.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('background-repeat-y', v); + }, + get: function () { + return this.getPropertyValue('background-repeat-y'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/backgroundSize.js b/node_modules/cssstyle/lib/properties/backgroundSize.js new file mode 100644 index 0000000..c4b4af2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/backgroundSize.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('background-size', v); + }, + get: function () { + return this.getPropertyValue('background-size'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/baselineShift.js b/node_modules/cssstyle/lib/properties/baselineShift.js new file mode 100644 index 0000000..a52252c --- /dev/null +++ b/node_modules/cssstyle/lib/properties/baselineShift.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('baseline-shift', v); + }, + get: function () { + return this.getPropertyValue('baseline-shift'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/border.js b/node_modules/cssstyle/lib/properties/border.js new file mode 100644 index 0000000..8cf97f6 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/border.js @@ -0,0 +1,49 @@ +'use strict'; + +var shorthandParser = require('../parsers').shorthandParser; +var shorthandSetter = require('../parsers').shorthandSetter; +var shorthandGetter = require('../parsers').shorthandGetter; + +var shorthand_for = { + 'border-width': require('./borderWidth'), + 'border-style': require('./borderStyle'), + 'border-color': require('./borderColor') +}; + +var isValid = function isValid(v) { + return shorthandParser(v, shorthand_for) !== undefined; +}; +module.exports.isValid = isValid; + +var parser = function (v) { + if (v.toString().toLowerCase() === 'none') { + v = ''; + } + if (isValid(v)) { + return v; + } + return undefined; +}; + +var myShorthandSetter = shorthandSetter('border', shorthand_for); +var myShorthandGetter = shorthandGetter('border', shorthand_for); + +module.exports.definition = { + set: function (v) { + if (v.toString().toLowerCase() === 'none') { + v = ''; + } + myShorthandSetter.call(this, v); + this.removeProperty('border-top'); + this.removeProperty('border-left'); + this.removeProperty('border-right'); + this.removeProperty('border-bottom'); + this._values['border-top'] = this._values.border; + this._values['border-left'] = this._values.border; + this._values['border-right'] = this._values.border; + this._values['border-bottom'] = this._values.border; + }, + get: myShorthandGetter, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderBottom.js b/node_modules/cssstyle/lib/properties/borderBottom.js new file mode 100644 index 0000000..bc01dd3 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderBottom.js @@ -0,0 +1,23 @@ +'use strict'; + +var shorthandSetter = require('../parsers').shorthandSetter; +var shorthandGetter = require('../parsers').shorthandGetter; +var shorthandParser = require('../parsers').shorthandParser; + +var shorthand_for = { + 'border-bottom-width': require('./borderBottomWidth'), + 'border-bottom-style': require('./borderBottomStyle'), + 'border-bottom-color': require('./borderBottomColor') +}; + +var isValid = function isValid(v) { + return shorthandParser(v, shorthand_for) !== undefined; +}; +module.exports.isValid = isValid; + +module.exports.definition = { + set: shorthandSetter('border-bottom', shorthand_for), + get: shorthandGetter('border-bottom', shorthand_for), + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderBottomColor.js b/node_modules/cssstyle/lib/properties/borderBottomColor.js new file mode 100644 index 0000000..f7581bb --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderBottomColor.js @@ -0,0 +1,16 @@ +'use strict'; + +var isValid = module.exports.isValid = require('./borderColor').isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + this._setProperty('border-bottom-color', v); + } + }, + get: function () { + return this.getPropertyValue('border-bottom-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderBottomLeftRadius.js b/node_modules/cssstyle/lib/properties/borderBottomLeftRadius.js new file mode 100644 index 0000000..0d340b7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderBottomLeftRadius.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-bottom-left-radius', v); + }, + get: function () { + return this.getPropertyValue('border-bottom-left-radius'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderBottomRightRadius.js b/node_modules/cssstyle/lib/properties/borderBottomRightRadius.js new file mode 100644 index 0000000..a63bffd --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderBottomRightRadius.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-bottom-right-radius', v); + }, + get: function () { + return this.getPropertyValue('border-bottom-right-radius'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderBottomStyle.js b/node_modules/cssstyle/lib/properties/borderBottomStyle.js new file mode 100644 index 0000000..59c8e93 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderBottomStyle.js @@ -0,0 +1,21 @@ +'use strict'; + +var isValid = require('./borderStyle').isValid; +module.exports.isValid = isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + if (v.toLowerCase() === 'none') { + v = ''; + this.removeProperty('border-bottom-width'); + } + this._setProperty('border-bottom-style', v); + } + }, + get: function () { + return this.getPropertyValue('border-bottom-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderBottomWidth.js b/node_modules/cssstyle/lib/properties/borderBottomWidth.js new file mode 100644 index 0000000..f03bd6f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderBottomWidth.js @@ -0,0 +1,16 @@ +'use strict'; + +var isValid = module.exports.isValid = require('./borderWidth').isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + this._setProperty('border-bottom-width', v); + } + }, + get: function () { + return this.getPropertyValue('border-bottom-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderCollapse.js b/node_modules/cssstyle/lib/properties/borderCollapse.js new file mode 100644 index 0000000..9df8b42 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderCollapse.js @@ -0,0 +1,25 @@ +'use strict'; + +var parsers = require('../parsers'); + +var parse = function parse(v) { + if (parsers.valueType(v) === parsers.TYPES.KEYWORD && (v.toLowerCase() === 'collapse' || v.toLowerCase() === 'separate' || v.toLowerCase() === 'inherit')) { + return v; + } + return undefined; +}; + +module.exports.isValid = function isValid(v) { + return parse(v) !== undefined; +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-collapse', parse(v)); + }, + get: function () { + return this.getPropertyValue('border-collapse'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderColor.js b/node_modules/cssstyle/lib/properties/borderColor.js new file mode 100644 index 0000000..a3c7a45 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderColor.js @@ -0,0 +1,28 @@ +'use strict'; + +var parsers = require('../parsers'); +var implicitSetter = require('../parsers').implicitSetter; + +module.exports.isValid = function parse(v) { + if (typeof v !== 'string') { + return false; + } + return (v === '' || v.toLowerCase() === 'transparent' || parsers.valueType(v) === parsers.TYPES.COLOR); +}; +var isValid = module.exports.isValid; + +var parser = function (v) { + if (isValid(v)) { + return v.toLowerCase(); + } + return undefined; +}; + +module.exports.definition = { + set: implicitSetter('border', 'color', isValid, parser), + get: function () { + return this.getPropertyValue('border-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderImage.js b/node_modules/cssstyle/lib/properties/borderImage.js new file mode 100644 index 0000000..6cbc016 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderImage.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-image', v); + }, + get: function () { + return this.getPropertyValue('border-image'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderImageOutset.js b/node_modules/cssstyle/lib/properties/borderImageOutset.js new file mode 100644 index 0000000..4df8fca --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderImageOutset.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-image-outset', v); + }, + get: function () { + return this.getPropertyValue('border-image-outset'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderImageRepeat.js b/node_modules/cssstyle/lib/properties/borderImageRepeat.js new file mode 100644 index 0000000..0752d86 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderImageRepeat.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-image-repeat', v); + }, + get: function () { + return this.getPropertyValue('border-image-repeat'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderImageSlice.js b/node_modules/cssstyle/lib/properties/borderImageSlice.js new file mode 100644 index 0000000..8429007 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderImageSlice.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-image-slice', v); + }, + get: function () { + return this.getPropertyValue('border-image-slice'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderImageSource.js b/node_modules/cssstyle/lib/properties/borderImageSource.js new file mode 100644 index 0000000..9f6228b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderImageSource.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-image-source', v); + }, + get: function () { + return this.getPropertyValue('border-image-source'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderImageWidth.js b/node_modules/cssstyle/lib/properties/borderImageWidth.js new file mode 100644 index 0000000..492fe73 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderImageWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-image-width', v); + }, + get: function () { + return this.getPropertyValue('border-image-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderLeft.js b/node_modules/cssstyle/lib/properties/borderLeft.js new file mode 100644 index 0000000..7f54157 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderLeft.js @@ -0,0 +1,23 @@ +'use strict'; + +var shorthandSetter = require('../parsers').shorthandSetter; +var shorthandGetter = require('../parsers').shorthandGetter; +var shorthandParser = require('../parsers').shorthandParser; + +var shorthand_for = { + 'border-left-width': require('./borderLeftWidth'), + 'border-left-style': require('./borderLeftStyle'), + 'border-left-color': require('./borderLeftColor') +}; + +var isValid = function isValid(v) { + return shorthandParser(v, shorthand_for) !== undefined; +}; +module.exports.isValid = isValid; + +module.exports.definition = { + set: shorthandSetter('border-left', shorthand_for), + get: shorthandGetter('border-left', shorthand_for), + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderLeftColor.js b/node_modules/cssstyle/lib/properties/borderLeftColor.js new file mode 100644 index 0000000..e28e531 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderLeftColor.js @@ -0,0 +1,16 @@ +'use strict'; + +var isValid = module.exports.isValid = require('./borderColor').isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + this._setProperty('border-left-color', v); + } + }, + get: function () { + return this.getPropertyValue('border-left-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderLeftStyle.js b/node_modules/cssstyle/lib/properties/borderLeftStyle.js new file mode 100644 index 0000000..402823a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderLeftStyle.js @@ -0,0 +1,21 @@ +'use strict'; + +var isValid = require('./borderStyle').isValid; +module.exports.isValid = isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + if (v.toLowerCase() === 'none') { + v = ''; + this.removeProperty('border-left-width'); + } + this._setProperty('border-left-style', v); + } + }, + get: function () { + return this.getPropertyValue('border-left-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderLeftWidth.js b/node_modules/cssstyle/lib/properties/borderLeftWidth.js new file mode 100644 index 0000000..e0e76e3 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderLeftWidth.js @@ -0,0 +1,16 @@ +'use strict'; + +var isValid = module.exports.isValid = require('./borderWidth').isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + this._setProperty('border-left-width', v); + } + }, + get: function () { + return this.getPropertyValue('border-left-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderRadius.js b/node_modules/cssstyle/lib/properties/borderRadius.js new file mode 100644 index 0000000..9b85c9e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderRadius.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-radius', v); + }, + get: function () { + return this.getPropertyValue('border-radius'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderRight.js b/node_modules/cssstyle/lib/properties/borderRight.js new file mode 100644 index 0000000..bfe1a78 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderRight.js @@ -0,0 +1,23 @@ +'use strict'; + +var shorthandSetter = require('../parsers').shorthandSetter; +var shorthandGetter = require('../parsers').shorthandGetter; +var shorthandParser = require('../parsers').shorthandParser; + +var shorthand_for = { + 'border-right-width': require('./borderRightWidth'), + 'border-right-style': require('./borderRightStyle'), + 'border-right-color': require('./borderRightColor') +}; + +var isValid = function isValid(v) { + return shorthandParser(v, shorthand_for) !== undefined; +}; +module.exports.isValid = isValid; + +module.exports.definition = { + set: shorthandSetter('border-right', shorthand_for), + get: shorthandGetter('border-right', shorthand_for), + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderRightColor.js b/node_modules/cssstyle/lib/properties/borderRightColor.js new file mode 100644 index 0000000..fe9e512 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderRightColor.js @@ -0,0 +1,16 @@ +'use strict'; + +var isValid = module.exports.isValid = require('./borderColor').isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + this._setProperty('border-right-color', v); + } + }, + get: function () { + return this.getPropertyValue('border-right-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderRightStyle.js b/node_modules/cssstyle/lib/properties/borderRightStyle.js new file mode 100644 index 0000000..7b794a2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderRightStyle.js @@ -0,0 +1,21 @@ +'use strict'; + +var isValid = require('./borderStyle').isValid; +module.exports.isValid = isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + if (v.toLowerCase() === 'none') { + v = ''; + this.removeProperty('border-right-width'); + } + this._setProperty('border-right-style', v); + } + }, + get: function () { + return this.getPropertyValue('border-right-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderRightWidth.js b/node_modules/cssstyle/lib/properties/borderRightWidth.js new file mode 100644 index 0000000..a9fe7dc --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderRightWidth.js @@ -0,0 +1,16 @@ +'use strict'; + +var isValid = module.exports.isValid = require('./borderWidth').isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + this._setProperty('border-right-width', v); + } + }, + get: function () { + return this.getPropertyValue('border-right-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderSpacing.js b/node_modules/cssstyle/lib/properties/borderSpacing.js new file mode 100644 index 0000000..7979bd2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderSpacing.js @@ -0,0 +1,42 @@ +'use strict'; + +var parsers = require('../parsers'); + +// ? | inherit +// if one, it applies to both horizontal and verical spacing +// if two, the first applies to the horizontal and the second applies to vertical spacing + +var parse = function parse(v) { + if (v === '' || v === null) { + return undefined; + } + if (v.toLowerCase() === 'inherit') { + return v; + } + var parts = v.split(/\s+/); + if (parts.length !== 1 && parts.length !== 2) { + return undefined; + } + parts.forEach(function (part) { + if (parsers.valueType(part) !== parsers.TYPES.LENGTH) { + return undefined; + } + }); + + return v; +}; + +module.exports.isValid = function isValid(v) { + return parse(v) !== undefined; +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-spacing', parse(v)); + }, + get: function () { + return this.getPropertyValue('border-spacing'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderStyle.js b/node_modules/cssstyle/lib/properties/borderStyle.js new file mode 100644 index 0000000..6f79f43 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderStyle.js @@ -0,0 +1,27 @@ +'use strict'; + +var implicitSetter = require('../parsers').implicitSetter; + +// the valid border-styles: +var styles = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset']; + +module.exports.isValid = function parse(v) { + return typeof v === 'string' && (v === '' || styles.indexOf(v) !== -1); +}; +var isValid = module.exports.isValid; + +var parser = function (v) { + if (isValid(v)) { + return v.toLowerCase(); + } + return undefined; +}; + +module.exports.definition = { + set: implicitSetter('border', 'style', isValid, parser), + get: function () { + return this.getPropertyValue('border-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderTop.js b/node_modules/cssstyle/lib/properties/borderTop.js new file mode 100644 index 0000000..98480e7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderTop.js @@ -0,0 +1,22 @@ +'use strict'; + +var shorthandSetter = require('../parsers').shorthandSetter; +var shorthandGetter = require('../parsers').shorthandGetter; +var shorthandParser = require('../parsers').shorthandParser; + +var shorthand_for = { + 'border-top-width': require('./borderTopWidth'), + 'border-top-style': require('./borderTopStyle'), + 'border-top-color': require('./borderTopColor') +}; + +module.exports.isValid = function (v) { + return shorthandParser(v, shorthand_for) !== undefined; +}; + +module.exports.definition = { + set: shorthandSetter('border-top', shorthand_for), + get: shorthandGetter('border-top', shorthand_for), + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderTopColor.js b/node_modules/cssstyle/lib/properties/borderTopColor.js new file mode 100644 index 0000000..60857df --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderTopColor.js @@ -0,0 +1,16 @@ +'use strict'; + +var isValid = module.exports.isValid = require('./borderColor').isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + this._setProperty('border-top-color', v); + } + }, + get: function () { + return this.getPropertyValue('border-top-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderTopLeftRadius.js b/node_modules/cssstyle/lib/properties/borderTopLeftRadius.js new file mode 100644 index 0000000..36c5ba1 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderTopLeftRadius.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-top-left-radius', v); + }, + get: function () { + return this.getPropertyValue('border-top-left-radius'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderTopRightRadius.js b/node_modules/cssstyle/lib/properties/borderTopRightRadius.js new file mode 100644 index 0000000..43a6bba --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderTopRightRadius.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('border-top-right-radius', v); + }, + get: function () { + return this.getPropertyValue('border-top-right-radius'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderTopStyle.js b/node_modules/cssstyle/lib/properties/borderTopStyle.js new file mode 100644 index 0000000..a593161 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderTopStyle.js @@ -0,0 +1,21 @@ +'use strict'; + +var isValid = require('./borderStyle').isValid; +module.exports.isValid = isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + if (v.toLowerCase() === 'none') { + v = ''; + this.removeProperty('border-top-width'); + } + this._setProperty('border-top-style', v); + } + }, + get: function () { + return this.getPropertyValue('border-top-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderTopWidth.js b/node_modules/cssstyle/lib/properties/borderTopWidth.js new file mode 100644 index 0000000..49deee8 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderTopWidth.js @@ -0,0 +1,17 @@ +'use strict'; + +var isValid = require('./borderWidth').isValid; +module.exports.isValid = isValid; + +module.exports.definition = { + set: function (v) { + if (isValid(v)) { + this._setProperty('border-top-width', v); + } + }, + get: function () { + return this.getPropertyValue('border-top-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/borderWidth.js b/node_modules/cssstyle/lib/properties/borderWidth.js new file mode 100644 index 0000000..0bcc63b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/borderWidth.js @@ -0,0 +1,47 @@ +'use strict'; + +var parsers = require('../parsers'); +var parsers = require('../parsers'); +var implicitSetter = require('../parsers').implicitSetter; + +// the valid border-widths: +var widths = ['thin', 'medium', 'thick']; + +module.exports.isValid = function parse(v) { + var length = parsers.parseLength(v); + if (length !== undefined) { + return true; + } + if (typeof v !== 'string') { + return false; + } + if (v === '') { + return true; + } + v = v.toLowerCase(); + if (widths.indexOf(v) === -1) { + return false; + } + return true; +}; +var isValid = module.exports.isValid; + +var parser = function (v) { + var length = parsers.parseLength(v); + if (length !== undefined) { + return length; + } + if (isValid(v)) { + return v.toLowerCase(); + } + return undefined; +}; + +module.exports.definition = { + set: implicitSetter('border', 'width', isValid, parser), + get: function () { + return this.getPropertyValue('border-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/bottom.js b/node_modules/cssstyle/lib/properties/bottom.js new file mode 100644 index 0000000..c7dda96 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/bottom.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseMeasurement = require('../parsers').parseMeasurement; + +module.exports.definition = { + set: function (v) { + this._setProperty('bottom', parseMeasurement(v)); + }, + get: function () { + return this.getPropertyValue('bottom'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/boxShadow.js b/node_modules/cssstyle/lib/properties/boxShadow.js new file mode 100644 index 0000000..e178451 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/boxShadow.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('box-shadow', v); + }, + get: function () { + return this.getPropertyValue('box-shadow'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/boxSizing.js b/node_modules/cssstyle/lib/properties/boxSizing.js new file mode 100644 index 0000000..35c6371 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/boxSizing.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('box-sizing', v); + }, + get: function () { + return this.getPropertyValue('box-sizing'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/captionSide.js b/node_modules/cssstyle/lib/properties/captionSide.js new file mode 100644 index 0000000..c1ef22b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/captionSide.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('caption-side', v); + }, + get: function () { + return this.getPropertyValue('caption-side'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/clear.js b/node_modules/cssstyle/lib/properties/clear.js new file mode 100644 index 0000000..44070e7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/clear.js @@ -0,0 +1,16 @@ +'use strict'; + +var parseKeyword = require('../parsers').parseKeyword; + +var clear_keywords = [ 'none', 'left', 'right', 'both', 'inherit' ]; + +module.exports.definition = { + set: function (v) { + this._setProperty('clear', parseKeyword(v, clear_keywords)); + }, + get: function () { + return this.getPropertyValue('clear'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/clip.js b/node_modules/cssstyle/lib/properties/clip.js new file mode 100644 index 0000000..fe8bc93 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/clip.js @@ -0,0 +1,49 @@ +'use strict'; + +var parseMeasurement = require('../parsers').parseMeasurement; + +/*jslint regexp: true*/ +var shape_regex = /^rect\((.*)\)$/i; +/*jslint regexp: false*/ + +var parse = function (val) { + if (val === '' || val === null) { + return val; + } + if (typeof val !== 'string') { + return undefined; + } + val = val.toLowerCase(); + if (val === 'auto' || val === 'inherit') { + return val; + } + var matches = val.match(shape_regex); + if (!matches) { + return undefined; + } + var parts = matches[1].split(/\s*,\s*/); + if (parts.length !== 4) { + return undefined; + } + var valid = parts.every(function (part, index) { + var measurement = parseMeasurement(part); + parts[index] = measurement; + return measurement !== undefined; + }); + if (!valid) { + return undefined; + } + parts = parts.join(', '); + return val.replace(matches[1], parts); +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('clip', parse(v)); + }, + get: function () { + return this.getPropertyValue('clip'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/color.js b/node_modules/cssstyle/lib/properties/color.js new file mode 100644 index 0000000..a709c6b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/color.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/colorInterpolation.js b/node_modules/cssstyle/lib/properties/colorInterpolation.js new file mode 100644 index 0000000..929f5de --- /dev/null +++ b/node_modules/cssstyle/lib/properties/colorInterpolation.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('color-interpolation', v); + }, + get: function () { + return this.getPropertyValue('color-interpolation'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/colorInterpolationFilters.js b/node_modules/cssstyle/lib/properties/colorInterpolationFilters.js new file mode 100644 index 0000000..4aab1a2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/colorInterpolationFilters.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('color-interpolation-filters', v); + }, + get: function () { + return this.getPropertyValue('color-interpolation-filters'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/colorProfile.js b/node_modules/cssstyle/lib/properties/colorProfile.js new file mode 100644 index 0000000..1440d06 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/colorProfile.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('color-profile', v); + }, + get: function () { + return this.getPropertyValue('color-profile'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/colorRendering.js b/node_modules/cssstyle/lib/properties/colorRendering.js new file mode 100644 index 0000000..58a4eb4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/colorRendering.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('color-rendering', v); + }, + get: function () { + return this.getPropertyValue('color-rendering'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/content.js b/node_modules/cssstyle/lib/properties/content.js new file mode 100644 index 0000000..68c4f43 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/content.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('content', v); + }, + get: function () { + return this.getPropertyValue('content'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/counterIncrement.js b/node_modules/cssstyle/lib/properties/counterIncrement.js new file mode 100644 index 0000000..b5b6591 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/counterIncrement.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('counter-increment', v); + }, + get: function () { + return this.getPropertyValue('counter-increment'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/counterReset.js b/node_modules/cssstyle/lib/properties/counterReset.js new file mode 100644 index 0000000..f4370f5 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/counterReset.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('counter-reset', v); + }, + get: function () { + return this.getPropertyValue('counter-reset'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/cssFloat.js b/node_modules/cssstyle/lib/properties/cssFloat.js new file mode 100644 index 0000000..65b4eda --- /dev/null +++ b/node_modules/cssstyle/lib/properties/cssFloat.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('float', v); + }, + get: function () { + return this.getPropertyValue('float'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/cue.js b/node_modules/cssstyle/lib/properties/cue.js new file mode 100644 index 0000000..59820a1 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/cue.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('cue', v); + }, + get: function () { + return this.getPropertyValue('cue'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/cueAfter.js b/node_modules/cssstyle/lib/properties/cueAfter.js new file mode 100644 index 0000000..dea8630 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/cueAfter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('cue-after', v); + }, + get: function () { + return this.getPropertyValue('cue-after'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/cueBefore.js b/node_modules/cssstyle/lib/properties/cueBefore.js new file mode 100644 index 0000000..ebdb6f2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/cueBefore.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('cue-before', v); + }, + get: function () { + return this.getPropertyValue('cue-before'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/cursor.js b/node_modules/cssstyle/lib/properties/cursor.js new file mode 100644 index 0000000..6a16a45 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/cursor.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('cursor', v); + }, + get: function () { + return this.getPropertyValue('cursor'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/direction.js b/node_modules/cssstyle/lib/properties/direction.js new file mode 100644 index 0000000..0bd1c33 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/direction.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('direction', v); + }, + get: function () { + return this.getPropertyValue('direction'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/display.js b/node_modules/cssstyle/lib/properties/display.js new file mode 100644 index 0000000..1701669 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/display.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('display', v); + }, + get: function () { + return this.getPropertyValue('display'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/dominantBaseline.js b/node_modules/cssstyle/lib/properties/dominantBaseline.js new file mode 100644 index 0000000..bb43287 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/dominantBaseline.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('dominant-baseline', v); + }, + get: function () { + return this.getPropertyValue('dominant-baseline'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/elevation.js b/node_modules/cssstyle/lib/properties/elevation.js new file mode 100644 index 0000000..4ba071a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/elevation.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('elevation', v); + }, + get: function () { + return this.getPropertyValue('elevation'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/emptyCells.js b/node_modules/cssstyle/lib/properties/emptyCells.js new file mode 100644 index 0000000..b4dc471 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/emptyCells.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('empty-cells', v); + }, + get: function () { + return this.getPropertyValue('empty-cells'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/enableBackground.js b/node_modules/cssstyle/lib/properties/enableBackground.js new file mode 100644 index 0000000..9572476 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/enableBackground.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('enable-background', v); + }, + get: function () { + return this.getPropertyValue('enable-background'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/fill.js b/node_modules/cssstyle/lib/properties/fill.js new file mode 100644 index 0000000..d848500 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/fill.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('fill', v); + }, + get: function () { + return this.getPropertyValue('fill'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/fillOpacity.js b/node_modules/cssstyle/lib/properties/fillOpacity.js new file mode 100644 index 0000000..abf941a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/fillOpacity.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('fill-opacity', v); + }, + get: function () { + return this.getPropertyValue('fill-opacity'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/fillRule.js b/node_modules/cssstyle/lib/properties/fillRule.js new file mode 100644 index 0000000..1d56429 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/fillRule.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('fill-rule', v); + }, + get: function () { + return this.getPropertyValue('fill-rule'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/filter.js b/node_modules/cssstyle/lib/properties/filter.js new file mode 100644 index 0000000..0c602f9 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/filter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('filter', v); + }, + get: function () { + return this.getPropertyValue('filter'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/floodColor.js b/node_modules/cssstyle/lib/properties/floodColor.js new file mode 100644 index 0000000..3a1d077 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/floodColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('flood-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('flood-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/floodOpacity.js b/node_modules/cssstyle/lib/properties/floodOpacity.js new file mode 100644 index 0000000..f4055b3 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/floodOpacity.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('flood-opacity', v); + }, + get: function () { + return this.getPropertyValue('flood-opacity'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/font.js b/node_modules/cssstyle/lib/properties/font.js new file mode 100644 index 0000000..8ec869d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/font.js @@ -0,0 +1,40 @@ +'use strict'; + +var TYPES = require('../parsers').TYPES; +var valueType = require('../parsers').valueType; +var shorthandParser = require('../parsers').shorthandParser; +var shorthandSetter = require('../parsers').shorthandSetter; +var shorthandGetter = require('../parsers').shorthandGetter; + +var shorthand_for = { + 'font-family': require('./fontFamily'), + 'font-size': require('./fontSize'), + 'font-style': require('./fontStyle'), + 'font-variant': require('./fontVariant'), + 'font-weight': require('./fontWeight'), + 'line-height': require('./lineHeight') +}; + +var static_fonts = ['caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar', 'inherit']; + +module.exports.isValid = function isValid(v) { + return (shorthandParser(v, shorthand_for) !== undefined) || + (valueType(v) === TYPES.KEYWORD && static_fonts.indexOf(v.toLowerCase()) !== -1); +}; + +var setter = shorthandSetter('font', shorthand_for); + +module.exports.definition = { + set: function (v) { + var short = shorthandParser(v, shorthand_for); + if (short !== undefined) { + return setter.call(this, v); + } + if (valueType(v) === TYPES.KEYWORD && static_fonts.indexOf(v.toLowerCase()) !== -1) { + this._setProperty('font', v); + } + }, + get: shorthandGetter('font', shorthand_for), + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/fontFamily.js b/node_modules/cssstyle/lib/properties/fontFamily.js new file mode 100644 index 0000000..c7169c1 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/fontFamily.js @@ -0,0 +1,33 @@ +'use strict'; + +var TYPES = require('../parsers').TYPES; +var valueType = require('../parsers').valueType; + +var partsRegEx = /\s*,\s*/; +module.exports.isValid = function isValid(v) { + if (v === '' || v === null) { + return true; + } + var parts = v.split(partsRegEx); + var len = parts.length; + var i; + var type; + for (i = 0; i < len; i++) { + type = valueType(parts[i]); + if (type === TYPES.STRING || type === TYPES.KEYWORD) { + return true; + } + } + return false; +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('font-family', v); + }, + get: function () { + return this.getPropertyValue('font-family'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/fontSize.js b/node_modules/cssstyle/lib/properties/fontSize.js new file mode 100644 index 0000000..0e33784 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/fontSize.js @@ -0,0 +1,25 @@ +'use strict'; + +var TYPES = require('../parsers').TYPES; +var valueType = require('../parsers').valueType; + +var absoluteSizes = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large']; +var relativeSizes = ['larger', 'smaller']; + +module.exports.isValid = function (v) { + var type = valueType(v.toLowerCase()); + return type === TYPES.LENGTH || type === TYPES.PERCENT || + (type === TYPES.KEYWORD && absoluteSizes.indexOf(v.toLowerCase()) !== -1) || + (type === TYPES.KEYWORD && relativeSizes.indexOf(v.toLowerCase()) !== -1); +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('font-size', v); + }, + get: function () { + return this.getPropertyValue('font-size'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/fontSizeAdjust.js b/node_modules/cssstyle/lib/properties/fontSizeAdjust.js new file mode 100644 index 0000000..ad8a45f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/fontSizeAdjust.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('font-size-adjust', v); + }, + get: function () { + return this.getPropertyValue('font-size-adjust'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/fontStretch.js b/node_modules/cssstyle/lib/properties/fontStretch.js new file mode 100644 index 0000000..da486a7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/fontStretch.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('font-stretch', v); + }, + get: function () { + return this.getPropertyValue('font-stretch'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/fontStyle.js b/node_modules/cssstyle/lib/properties/fontStyle.js new file mode 100644 index 0000000..d0eefbb --- /dev/null +++ b/node_modules/cssstyle/lib/properties/fontStyle.js @@ -0,0 +1,18 @@ +'use strict'; + +var valid_styles = ['normal', 'italic', 'oblique', 'inherit']; + +module.exports.isValid = function (v) { + return valid_styles.indexOf(v.toLowerCase()) !== -1; +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('font-style', v); + }, + get: function () { + return this.getPropertyValue('font-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/fontVariant.js b/node_modules/cssstyle/lib/properties/fontVariant.js new file mode 100644 index 0000000..84711a4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/fontVariant.js @@ -0,0 +1,18 @@ +'use strict'; + +var valid_variants = ['normal', 'small-caps', 'inherit']; + +module.exports.isValid = function isValid(v) { + return valid_variants.indexOf(v.toLowerCase()) !== -1; +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('font-variant', v); + }, + get: function () { + return this.getPropertyValue('font-variant'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/fontWeight.js b/node_modules/cssstyle/lib/properties/fontWeight.js new file mode 100644 index 0000000..7d6702d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/fontWeight.js @@ -0,0 +1,18 @@ +'use strict'; + +var valid_weights = ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'inherit']; + +module.exports.isValid = function isValid(v) { + return valid_weights.indexOf(v.toLowerCase()) !== -1; +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('font-weight', v); + }, + get: function () { + return this.getPropertyValue('font-weight'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/glyphOrientationHorizontal.js b/node_modules/cssstyle/lib/properties/glyphOrientationHorizontal.js new file mode 100644 index 0000000..fb685ef --- /dev/null +++ b/node_modules/cssstyle/lib/properties/glyphOrientationHorizontal.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('glyph-orientation-horizontal', v); + }, + get: function () { + return this.getPropertyValue('glyph-orientation-horizontal'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/glyphOrientationVertical.js b/node_modules/cssstyle/lib/properties/glyphOrientationVertical.js new file mode 100644 index 0000000..8eb59d0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/glyphOrientationVertical.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('glyph-orientation-vertical', v); + }, + get: function () { + return this.getPropertyValue('glyph-orientation-vertical'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/height.js b/node_modules/cssstyle/lib/properties/height.js new file mode 100644 index 0000000..dec46da --- /dev/null +++ b/node_modules/cssstyle/lib/properties/height.js @@ -0,0 +1,24 @@ +'use strict'; + +var parseMeasurement = require('../parsers').parseMeasurement; + +function parse(v) { + if (String(v).toLowerCase() === 'auto') { + return 'auto'; + } + if (String(v).toLowerCase() === 'inherit') { + return 'inherit'; + } + return parseMeasurement(v); +} + +module.exports.definition = { + set: function (v) { + this._setProperty('height', parse(v)); + }, + get: function () { + return this.getPropertyValue('height'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/imageRendering.js b/node_modules/cssstyle/lib/properties/imageRendering.js new file mode 100644 index 0000000..4c09b3c --- /dev/null +++ b/node_modules/cssstyle/lib/properties/imageRendering.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('image-rendering', v); + }, + get: function () { + return this.getPropertyValue('image-rendering'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/kerning.js b/node_modules/cssstyle/lib/properties/kerning.js new file mode 100644 index 0000000..2762746 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/kerning.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('kerning', v); + }, + get: function () { + return this.getPropertyValue('kerning'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/left.js b/node_modules/cssstyle/lib/properties/left.js new file mode 100644 index 0000000..040d3ba --- /dev/null +++ b/node_modules/cssstyle/lib/properties/left.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseMeasurement = require('../parsers').parseMeasurement; + +module.exports.definition = { + set: function (v) { + this._setProperty('left', parseMeasurement(v)); + }, + get: function () { + return this.getPropertyValue('left'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/letterSpacing.js b/node_modules/cssstyle/lib/properties/letterSpacing.js new file mode 100644 index 0000000..43ffdd7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/letterSpacing.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('letter-spacing', v); + }, + get: function () { + return this.getPropertyValue('letter-spacing'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/lightingColor.js b/node_modules/cssstyle/lib/properties/lightingColor.js new file mode 100644 index 0000000..162f4b7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/lightingColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('lighting-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('lighting-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/lineHeight.js b/node_modules/cssstyle/lib/properties/lineHeight.js new file mode 100644 index 0000000..e77a42b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/lineHeight.js @@ -0,0 +1,21 @@ +'use strict'; + +var TYPES = require('../parsers').TYPES; +var valueType = require('../parsers').valueType; + +module.exports.isValid = function isValid(v) { + var type = valueType(v); + return (type === TYPES.KEYWORD && (v.toLowerCase() === 'normal') || (v.toLowerCase() === 'inherit')) || + type === TYPES.NUMBER || type === TYPES.LENGTH || type === TYPES.PERCENT; +}; + +module.exports.definition = { + set: function (v) { + this._setProperty('line-height', v); + }, + get: function () { + return this.getPropertyValue('line-height'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/listStyle.js b/node_modules/cssstyle/lib/properties/listStyle.js new file mode 100644 index 0000000..4757b8b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/listStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('list-style', v); + }, + get: function () { + return this.getPropertyValue('list-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/listStyleImage.js b/node_modules/cssstyle/lib/properties/listStyleImage.js new file mode 100644 index 0000000..15324b2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/listStyleImage.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('list-style-image', v); + }, + get: function () { + return this.getPropertyValue('list-style-image'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/listStylePosition.js b/node_modules/cssstyle/lib/properties/listStylePosition.js new file mode 100644 index 0000000..55afa70 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/listStylePosition.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('list-style-position', v); + }, + get: function () { + return this.getPropertyValue('list-style-position'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/listStyleType.js b/node_modules/cssstyle/lib/properties/listStyleType.js new file mode 100644 index 0000000..353c98f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/listStyleType.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('list-style-type', v); + }, + get: function () { + return this.getPropertyValue('list-style-type'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/margin.js b/node_modules/cssstyle/lib/properties/margin.js new file mode 100644 index 0000000..35803a8 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/margin.js @@ -0,0 +1,59 @@ +'use strict'; + +var parsers = require('../parsers.js'); +var TYPES = parsers.TYPES; + +var isValid = function (v) { + if (v.toLowerCase() === "auto") { + return true; + } + var type = parsers.valueType(v); + return type === TYPES.LENGTH || type === TYPES.PERCENT || (type === TYPES.INTEGER && (v === '0' || v === 0)); +}; + +var parser = function (v) { + var V = v.toLowerCase(); + if (V === "auto") { + return V; + } + return parsers.parseMeasurement(v); +}; + +var mySetter = parsers.implicitSetter('margin', '', isValid, parser); +var myGlobal = parsers.implicitSetter('margin', '', function () { + return true; +}, function (v) { + return v; +}); + +module.exports.definition = { + set: function (v) { + if (typeof v === "number") { + v = String(v); + } + if (typeof v !== "string") { + return; + } + var V = v.toLowerCase(); + switch (V) { + case 'inherit': + case 'initial': + case 'unset': + case '': + myGlobal.call(this, V); + break; + + default: + mySetter.call(this, v); + break; + } + }, + get: function () { + return this.getPropertyValue('margin'); + }, + enumerable: true, + configurable: true +}; + +module.exports.isValid = isValid; +module.exports.parser = parser; diff --git a/node_modules/cssstyle/lib/properties/marginBottom.js b/node_modules/cssstyle/lib/properties/marginBottom.js new file mode 100644 index 0000000..05fbb47 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/marginBottom.js @@ -0,0 +1,13 @@ +'use strict'; + +var margin = require('./margin.js'); +var parsers = require('../parsers.js'); + +module.exports.definition = { + set: parsers.subImplicitSetter('margin', 'bottom', margin.isValid, margin.parser), + get: function () { + return this.getPropertyValue('margin-bottom'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/marginLeft.js b/node_modules/cssstyle/lib/properties/marginLeft.js new file mode 100644 index 0000000..e1b884d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/marginLeft.js @@ -0,0 +1,13 @@ +'use strict'; + +var margin = require('./margin.js'); +var parsers = require('../parsers.js'); + +module.exports.definition = { + set: parsers.subImplicitSetter('margin', 'left', margin.isValid, margin.parser), + get: function () { + return this.getPropertyValue('margin-left'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/marginRight.js b/node_modules/cssstyle/lib/properties/marginRight.js new file mode 100644 index 0000000..addb7f8 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/marginRight.js @@ -0,0 +1,13 @@ +'use strict'; + +var margin = require('./margin.js'); +var parsers = require('../parsers.js'); + +module.exports.definition = { + set: parsers.subImplicitSetter('margin', 'right', margin.isValid, margin.parser), + get: function () { + return this.getPropertyValue('margin-right'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/marginTop.js b/node_modules/cssstyle/lib/properties/marginTop.js new file mode 100644 index 0000000..40aedd4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/marginTop.js @@ -0,0 +1,13 @@ +'use strict'; + +var margin = require('./margin.js'); +var parsers = require('../parsers.js'); + +module.exports.definition = { + set: parsers.subImplicitSetter('margin', 'top', margin.isValid, margin.parser), + get: function () { + return this.getPropertyValue('margin-top'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/marker.js b/node_modules/cssstyle/lib/properties/marker.js new file mode 100644 index 0000000..5084cc0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/marker.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('marker', v); + }, + get: function () { + return this.getPropertyValue('marker'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/markerEnd.js b/node_modules/cssstyle/lib/properties/markerEnd.js new file mode 100644 index 0000000..4d3d75b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/markerEnd.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('marker-end', v); + }, + get: function () { + return this.getPropertyValue('marker-end'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/markerMid.js b/node_modules/cssstyle/lib/properties/markerMid.js new file mode 100644 index 0000000..d0237f6 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/markerMid.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('marker-mid', v); + }, + get: function () { + return this.getPropertyValue('marker-mid'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/markerOffset.js b/node_modules/cssstyle/lib/properties/markerOffset.js new file mode 100644 index 0000000..17dcbe0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/markerOffset.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('marker-offset', v); + }, + get: function () { + return this.getPropertyValue('marker-offset'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/markerStart.js b/node_modules/cssstyle/lib/properties/markerStart.js new file mode 100644 index 0000000..c941644 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/markerStart.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('marker-start', v); + }, + get: function () { + return this.getPropertyValue('marker-start'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/marks.js b/node_modules/cssstyle/lib/properties/marks.js new file mode 100644 index 0000000..5d3d475 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/marks.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('marks', v); + }, + get: function () { + return this.getPropertyValue('marks'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/mask.js b/node_modules/cssstyle/lib/properties/mask.js new file mode 100644 index 0000000..aa0350a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/mask.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('mask', v); + }, + get: function () { + return this.getPropertyValue('mask'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/maxHeight.js b/node_modules/cssstyle/lib/properties/maxHeight.js new file mode 100644 index 0000000..3c30aca --- /dev/null +++ b/node_modules/cssstyle/lib/properties/maxHeight.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('max-height', v); + }, + get: function () { + return this.getPropertyValue('max-height'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/maxWidth.js b/node_modules/cssstyle/lib/properties/maxWidth.js new file mode 100644 index 0000000..1a12056 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/maxWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('max-width', v); + }, + get: function () { + return this.getPropertyValue('max-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/minHeight.js b/node_modules/cssstyle/lib/properties/minHeight.js new file mode 100644 index 0000000..7e02a8a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/minHeight.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('min-height', v); + }, + get: function () { + return this.getPropertyValue('min-height'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/minWidth.js b/node_modules/cssstyle/lib/properties/minWidth.js new file mode 100644 index 0000000..1fca174 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/minWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('min-width', v); + }, + get: function () { + return this.getPropertyValue('min-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/opacity.js b/node_modules/cssstyle/lib/properties/opacity.js new file mode 100644 index 0000000..2f5c547 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/opacity.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseNumber = require('../parsers').parseNumber; + +module.exports.definition = { + set: function (v) { + this._setProperty('opacity', parseNumber(v)); + }, + get: function () { + return this.getPropertyValue('opacity'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/orphans.js b/node_modules/cssstyle/lib/properties/orphans.js new file mode 100644 index 0000000..a68614d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/orphans.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('orphans', v); + }, + get: function () { + return this.getPropertyValue('orphans'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/outline.js b/node_modules/cssstyle/lib/properties/outline.js new file mode 100644 index 0000000..779f6ec --- /dev/null +++ b/node_modules/cssstyle/lib/properties/outline.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('outline', v); + }, + get: function () { + return this.getPropertyValue('outline'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/outlineColor.js b/node_modules/cssstyle/lib/properties/outlineColor.js new file mode 100644 index 0000000..ae2135a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/outlineColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('outline-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('outline-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/outlineOffset.js b/node_modules/cssstyle/lib/properties/outlineOffset.js new file mode 100644 index 0000000..fba8ce4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/outlineOffset.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('outline-offset', v); + }, + get: function () { + return this.getPropertyValue('outline-offset'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/outlineStyle.js b/node_modules/cssstyle/lib/properties/outlineStyle.js new file mode 100644 index 0000000..1a59938 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/outlineStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('outline-style', v); + }, + get: function () { + return this.getPropertyValue('outline-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/outlineWidth.js b/node_modules/cssstyle/lib/properties/outlineWidth.js new file mode 100644 index 0000000..dcef18b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/outlineWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('outline-width', v); + }, + get: function () { + return this.getPropertyValue('outline-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/overflow.js b/node_modules/cssstyle/lib/properties/overflow.js new file mode 100644 index 0000000..61092e3 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/overflow.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('overflow', v); + }, + get: function () { + return this.getPropertyValue('overflow'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/overflowX.js b/node_modules/cssstyle/lib/properties/overflowX.js new file mode 100644 index 0000000..1e9951f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/overflowX.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('overflow-x', v); + }, + get: function () { + return this.getPropertyValue('overflow-x'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/overflowY.js b/node_modules/cssstyle/lib/properties/overflowY.js new file mode 100644 index 0000000..dfe0387 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/overflowY.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('overflow-y', v); + }, + get: function () { + return this.getPropertyValue('overflow-y'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/padding.js b/node_modules/cssstyle/lib/properties/padding.js new file mode 100644 index 0000000..3d82872 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/padding.js @@ -0,0 +1,52 @@ +'use strict'; + +var parsers = require('../parsers.js'); +var TYPES = parsers.TYPES; + +var isValid = function (v) { + var type = parsers.valueType(v); + return type === TYPES.LENGTH || type === TYPES.PERCENT || (type === TYPES.INTEGER && (v === '0' || v === 0)); +}; + +var parser = function (v) { + return parsers.parseMeasurement(v); +}; + +var mySetter = parsers.implicitSetter('padding', '', isValid, parser); +var myGlobal = parsers.implicitSetter('padding', '', function () { + return true; +}, function (v) { + return v; +}); + +module.exports.definition = { + set: function (v) { + if (typeof v === "number") { + v = String(v); + } + if (typeof v !== "string") { + return; + } + var V = v.toLowerCase(); + switch (V) { + case 'inherit': + case 'initial': + case 'unset': + case '': + myGlobal.call(this, V); + break; + + default: + mySetter.call(this, v); + break; + } + }, + get: function () { + return this.getPropertyValue('padding'); + }, + enumerable: true, + configurable: true +}; + +module.exports.isValid = isValid; +module.exports.parser = parser; diff --git a/node_modules/cssstyle/lib/properties/paddingBottom.js b/node_modules/cssstyle/lib/properties/paddingBottom.js new file mode 100644 index 0000000..1645a78 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/paddingBottom.js @@ -0,0 +1,13 @@ +'use strict'; + +var padding = require('./padding.js'); +var parsers = require('../parsers.js'); + +module.exports.definition = { + set: parsers.subImplicitSetter('padding', 'bottom', padding.isValid, padding.parser), + get: function () { + return this.getPropertyValue('padding-bottom'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/paddingLeft.js b/node_modules/cssstyle/lib/properties/paddingLeft.js new file mode 100644 index 0000000..8ace3ae --- /dev/null +++ b/node_modules/cssstyle/lib/properties/paddingLeft.js @@ -0,0 +1,13 @@ +'use strict'; + +var padding = require('./padding.js'); +var parsers = require('../parsers.js'); + +module.exports.definition = { + set: parsers.subImplicitSetter('padding', 'left', padding.isValid, padding.parser), + get: function () { + return this.getPropertyValue('padding-left'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/paddingRight.js b/node_modules/cssstyle/lib/properties/paddingRight.js new file mode 100644 index 0000000..c32e7c1 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/paddingRight.js @@ -0,0 +1,13 @@ +'use strict'; + +var padding = require('./padding.js'); +var parsers = require('../parsers.js'); + +module.exports.definition = { + set: parsers.subImplicitSetter('padding', 'right', padding.isValid, padding.parser), + get: function () { + return this.getPropertyValue('padding-right'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/paddingTop.js b/node_modules/cssstyle/lib/properties/paddingTop.js new file mode 100644 index 0000000..9df114d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/paddingTop.js @@ -0,0 +1,13 @@ +'use strict'; + +var padding = require('./padding.js'); +var parsers = require('../parsers.js'); + +module.exports.definition = { + set: parsers.subImplicitSetter('padding', 'top', padding.isValid, padding.parser), + get: function () { + return this.getPropertyValue('padding-top'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/page.js b/node_modules/cssstyle/lib/properties/page.js new file mode 100644 index 0000000..02b4e21 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/page.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('page', v); + }, + get: function () { + return this.getPropertyValue('page'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/pageBreakAfter.js b/node_modules/cssstyle/lib/properties/pageBreakAfter.js new file mode 100644 index 0000000..7a61f1f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/pageBreakAfter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('page-break-after', v); + }, + get: function () { + return this.getPropertyValue('page-break-after'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/pageBreakBefore.js b/node_modules/cssstyle/lib/properties/pageBreakBefore.js new file mode 100644 index 0000000..94a4987 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/pageBreakBefore.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('page-break-before', v); + }, + get: function () { + return this.getPropertyValue('page-break-before'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/pageBreakInside.js b/node_modules/cssstyle/lib/properties/pageBreakInside.js new file mode 100644 index 0000000..e458e6a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/pageBreakInside.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('page-break-inside', v); + }, + get: function () { + return this.getPropertyValue('page-break-inside'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/pause.js b/node_modules/cssstyle/lib/properties/pause.js new file mode 100644 index 0000000..dbf94b7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/pause.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('pause', v); + }, + get: function () { + return this.getPropertyValue('pause'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/pauseAfter.js b/node_modules/cssstyle/lib/properties/pauseAfter.js new file mode 100644 index 0000000..11ce039 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/pauseAfter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('pause-after', v); + }, + get: function () { + return this.getPropertyValue('pause-after'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/pauseBefore.js b/node_modules/cssstyle/lib/properties/pauseBefore.js new file mode 100644 index 0000000..3059ea5 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/pauseBefore.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('pause-before', v); + }, + get: function () { + return this.getPropertyValue('pause-before'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/pitch.js b/node_modules/cssstyle/lib/properties/pitch.js new file mode 100644 index 0000000..b47cbd2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/pitch.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('pitch', v); + }, + get: function () { + return this.getPropertyValue('pitch'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/pitchRange.js b/node_modules/cssstyle/lib/properties/pitchRange.js new file mode 100644 index 0000000..d442840 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/pitchRange.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('pitch-range', v); + }, + get: function () { + return this.getPropertyValue('pitch-range'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/playDuring.js b/node_modules/cssstyle/lib/properties/playDuring.js new file mode 100644 index 0000000..ce478ee --- /dev/null +++ b/node_modules/cssstyle/lib/properties/playDuring.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('play-during', v); + }, + get: function () { + return this.getPropertyValue('play-during'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/pointerEvents.js b/node_modules/cssstyle/lib/properties/pointerEvents.js new file mode 100644 index 0000000..067ea62 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/pointerEvents.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('pointer-events', v); + }, + get: function () { + return this.getPropertyValue('pointer-events'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/position.js b/node_modules/cssstyle/lib/properties/position.js new file mode 100644 index 0000000..9535b76 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/position.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('position', v); + }, + get: function () { + return this.getPropertyValue('position'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/quotes.js b/node_modules/cssstyle/lib/properties/quotes.js new file mode 100644 index 0000000..c90f09b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/quotes.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('quotes', v); + }, + get: function () { + return this.getPropertyValue('quotes'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/resize.js b/node_modules/cssstyle/lib/properties/resize.js new file mode 100644 index 0000000..4ec6adc --- /dev/null +++ b/node_modules/cssstyle/lib/properties/resize.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('resize', v); + }, + get: function () { + return this.getPropertyValue('resize'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/richness.js b/node_modules/cssstyle/lib/properties/richness.js new file mode 100644 index 0000000..76ec02a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/richness.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('richness', v); + }, + get: function () { + return this.getPropertyValue('richness'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/right.js b/node_modules/cssstyle/lib/properties/right.js new file mode 100644 index 0000000..aa5db0e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/right.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseMeasurement = require('../parsers').parseMeasurement; + +module.exports.definition = { + set: function (v) { + this._setProperty('right', parseMeasurement(v)); + }, + get: function () { + return this.getPropertyValue('right'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/shapeRendering.js b/node_modules/cssstyle/lib/properties/shapeRendering.js new file mode 100644 index 0000000..d8b0191 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/shapeRendering.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('shape-rendering', v); + }, + get: function () { + return this.getPropertyValue('shape-rendering'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/size.js b/node_modules/cssstyle/lib/properties/size.js new file mode 100644 index 0000000..76792c9 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/size.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('size', v); + }, + get: function () { + return this.getPropertyValue('size'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/speak.js b/node_modules/cssstyle/lib/properties/speak.js new file mode 100644 index 0000000..422ae8b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/speak.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('speak', v); + }, + get: function () { + return this.getPropertyValue('speak'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/speakHeader.js b/node_modules/cssstyle/lib/properties/speakHeader.js new file mode 100644 index 0000000..09bf191 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/speakHeader.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('speak-header', v); + }, + get: function () { + return this.getPropertyValue('speak-header'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/speakNumeral.js b/node_modules/cssstyle/lib/properties/speakNumeral.js new file mode 100644 index 0000000..c41e38a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/speakNumeral.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('speak-numeral', v); + }, + get: function () { + return this.getPropertyValue('speak-numeral'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/speakPunctuation.js b/node_modules/cssstyle/lib/properties/speakPunctuation.js new file mode 100644 index 0000000..dc60da0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/speakPunctuation.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('speak-punctuation', v); + }, + get: function () { + return this.getPropertyValue('speak-punctuation'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/speechRate.js b/node_modules/cssstyle/lib/properties/speechRate.js new file mode 100644 index 0000000..d561f9b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/speechRate.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('speech-rate', v); + }, + get: function () { + return this.getPropertyValue('speech-rate'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/src.js b/node_modules/cssstyle/lib/properties/src.js new file mode 100644 index 0000000..a04dbea --- /dev/null +++ b/node_modules/cssstyle/lib/properties/src.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('src', v); + }, + get: function () { + return this.getPropertyValue('src'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/stopColor.js b/node_modules/cssstyle/lib/properties/stopColor.js new file mode 100644 index 0000000..c6919bb --- /dev/null +++ b/node_modules/cssstyle/lib/properties/stopColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('stop-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('stop-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/stopOpacity.js b/node_modules/cssstyle/lib/properties/stopOpacity.js new file mode 100644 index 0000000..4e60be0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/stopOpacity.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('stop-opacity', v); + }, + get: function () { + return this.getPropertyValue('stop-opacity'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/stress.js b/node_modules/cssstyle/lib/properties/stress.js new file mode 100644 index 0000000..6e369a7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/stress.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('stress', v); + }, + get: function () { + return this.getPropertyValue('stress'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/stroke.js b/node_modules/cssstyle/lib/properties/stroke.js new file mode 100644 index 0000000..c58dd22 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/stroke.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('stroke', v); + }, + get: function () { + return this.getPropertyValue('stroke'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/strokeDasharray.js b/node_modules/cssstyle/lib/properties/strokeDasharray.js new file mode 100644 index 0000000..92334b2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/strokeDasharray.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('stroke-dasharray', v); + }, + get: function () { + return this.getPropertyValue('stroke-dasharray'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/strokeDashoffset.js b/node_modules/cssstyle/lib/properties/strokeDashoffset.js new file mode 100644 index 0000000..54d496f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/strokeDashoffset.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('stroke-dashoffset', v); + }, + get: function () { + return this.getPropertyValue('stroke-dashoffset'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/strokeLinecap.js b/node_modules/cssstyle/lib/properties/strokeLinecap.js new file mode 100644 index 0000000..e241a87 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/strokeLinecap.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('stroke-linecap', v); + }, + get: function () { + return this.getPropertyValue('stroke-linecap'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/strokeLinejoin.js b/node_modules/cssstyle/lib/properties/strokeLinejoin.js new file mode 100644 index 0000000..61ef9d9 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/strokeLinejoin.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('stroke-linejoin', v); + }, + get: function () { + return this.getPropertyValue('stroke-linejoin'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/strokeMiterlimit.js b/node_modules/cssstyle/lib/properties/strokeMiterlimit.js new file mode 100644 index 0000000..fe69cbf --- /dev/null +++ b/node_modules/cssstyle/lib/properties/strokeMiterlimit.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('stroke-miterlimit', v); + }, + get: function () { + return this.getPropertyValue('stroke-miterlimit'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/strokeOpacity.js b/node_modules/cssstyle/lib/properties/strokeOpacity.js new file mode 100644 index 0000000..1dc9324 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/strokeOpacity.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('stroke-opacity', v); + }, + get: function () { + return this.getPropertyValue('stroke-opacity'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/strokeWidth.js b/node_modules/cssstyle/lib/properties/strokeWidth.js new file mode 100644 index 0000000..84d3268 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/strokeWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('stroke-width', v); + }, + get: function () { + return this.getPropertyValue('stroke-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/tableLayout.js b/node_modules/cssstyle/lib/properties/tableLayout.js new file mode 100644 index 0000000..48f7484 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/tableLayout.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('table-layout', v); + }, + get: function () { + return this.getPropertyValue('table-layout'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textAlign.js b/node_modules/cssstyle/lib/properties/textAlign.js new file mode 100644 index 0000000..f6d994f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textAlign.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-align', v); + }, + get: function () { + return this.getPropertyValue('text-align'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textAnchor.js b/node_modules/cssstyle/lib/properties/textAnchor.js new file mode 100644 index 0000000..392799b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textAnchor.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-anchor', v); + }, + get: function () { + return this.getPropertyValue('text-anchor'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textDecoration.js b/node_modules/cssstyle/lib/properties/textDecoration.js new file mode 100644 index 0000000..680e808 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textDecoration.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-decoration', v); + }, + get: function () { + return this.getPropertyValue('text-decoration'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textIndent.js b/node_modules/cssstyle/lib/properties/textIndent.js new file mode 100644 index 0000000..3c07750 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textIndent.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-indent', v); + }, + get: function () { + return this.getPropertyValue('text-indent'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textLineThrough.js b/node_modules/cssstyle/lib/properties/textLineThrough.js new file mode 100644 index 0000000..29f4c3c --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textLineThrough.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-line-through', v); + }, + get: function () { + return this.getPropertyValue('text-line-through'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textLineThroughColor.js b/node_modules/cssstyle/lib/properties/textLineThroughColor.js new file mode 100644 index 0000000..2357ed8 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textLineThroughColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-line-through-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('text-line-through-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textLineThroughMode.js b/node_modules/cssstyle/lib/properties/textLineThroughMode.js new file mode 100644 index 0000000..dca3d9b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textLineThroughMode.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-line-through-mode', v); + }, + get: function () { + return this.getPropertyValue('text-line-through-mode'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textLineThroughStyle.js b/node_modules/cssstyle/lib/properties/textLineThroughStyle.js new file mode 100644 index 0000000..db1ad85 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textLineThroughStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-line-through-style', v); + }, + get: function () { + return this.getPropertyValue('text-line-through-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textLineThroughWidth.js b/node_modules/cssstyle/lib/properties/textLineThroughWidth.js new file mode 100644 index 0000000..1c64a50 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textLineThroughWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-line-through-width', v); + }, + get: function () { + return this.getPropertyValue('text-line-through-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textOverflow.js b/node_modules/cssstyle/lib/properties/textOverflow.js new file mode 100644 index 0000000..e6fc25e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textOverflow.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-overflow', v); + }, + get: function () { + return this.getPropertyValue('text-overflow'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textOverline.js b/node_modules/cssstyle/lib/properties/textOverline.js new file mode 100644 index 0000000..1991b6b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textOverline.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-overline', v); + }, + get: function () { + return this.getPropertyValue('text-overline'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textOverlineColor.js b/node_modules/cssstyle/lib/properties/textOverlineColor.js new file mode 100644 index 0000000..578fda5 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textOverlineColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-overline-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('text-overline-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textOverlineMode.js b/node_modules/cssstyle/lib/properties/textOverlineMode.js new file mode 100644 index 0000000..597adae --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textOverlineMode.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-overline-mode', v); + }, + get: function () { + return this.getPropertyValue('text-overline-mode'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textOverlineStyle.js b/node_modules/cssstyle/lib/properties/textOverlineStyle.js new file mode 100644 index 0000000..83165f0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textOverlineStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-overline-style', v); + }, + get: function () { + return this.getPropertyValue('text-overline-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textOverlineWidth.js b/node_modules/cssstyle/lib/properties/textOverlineWidth.js new file mode 100644 index 0000000..b40ef7e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textOverlineWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-overline-width', v); + }, + get: function () { + return this.getPropertyValue('text-overline-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textRendering.js b/node_modules/cssstyle/lib/properties/textRendering.js new file mode 100644 index 0000000..2886ef3 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textRendering.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-rendering', v); + }, + get: function () { + return this.getPropertyValue('text-rendering'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textShadow.js b/node_modules/cssstyle/lib/properties/textShadow.js new file mode 100644 index 0000000..e50d9fa --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textShadow.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-shadow', v); + }, + get: function () { + return this.getPropertyValue('text-shadow'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textTransform.js b/node_modules/cssstyle/lib/properties/textTransform.js new file mode 100644 index 0000000..3836e00 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textTransform.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-transform', v); + }, + get: function () { + return this.getPropertyValue('text-transform'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textUnderline.js b/node_modules/cssstyle/lib/properties/textUnderline.js new file mode 100644 index 0000000..baeaf65 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textUnderline.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-underline', v); + }, + get: function () { + return this.getPropertyValue('text-underline'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textUnderlineColor.js b/node_modules/cssstyle/lib/properties/textUnderlineColor.js new file mode 100644 index 0000000..2814dea --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textUnderlineColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-underline-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('text-underline-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textUnderlineMode.js b/node_modules/cssstyle/lib/properties/textUnderlineMode.js new file mode 100644 index 0000000..dcb6e71 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textUnderlineMode.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-underline-mode', v); + }, + get: function () { + return this.getPropertyValue('text-underline-mode'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textUnderlineStyle.js b/node_modules/cssstyle/lib/properties/textUnderlineStyle.js new file mode 100644 index 0000000..ac3a77e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textUnderlineStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-underline-style', v); + }, + get: function () { + return this.getPropertyValue('text-underline-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/textUnderlineWidth.js b/node_modules/cssstyle/lib/properties/textUnderlineWidth.js new file mode 100644 index 0000000..91b0d88 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/textUnderlineWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('text-underline-width', v); + }, + get: function () { + return this.getPropertyValue('text-underline-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/top.js b/node_modules/cssstyle/lib/properties/top.js new file mode 100644 index 0000000..aac4005 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/top.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseMeasurement = require('../parsers').parseMeasurement; + +module.exports.definition = { + set: function (v) { + this._setProperty('top', parseMeasurement(v)); + }, + get: function () { + return this.getPropertyValue('top'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/unicodeBidi.js b/node_modules/cssstyle/lib/properties/unicodeBidi.js new file mode 100644 index 0000000..c443a9e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/unicodeBidi.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('unicode-bidi', v); + }, + get: function () { + return this.getPropertyValue('unicode-bidi'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/unicodeRange.js b/node_modules/cssstyle/lib/properties/unicodeRange.js new file mode 100644 index 0000000..e084396 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/unicodeRange.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('unicode-range', v); + }, + get: function () { + return this.getPropertyValue('unicode-range'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/vectorEffect.js b/node_modules/cssstyle/lib/properties/vectorEffect.js new file mode 100644 index 0000000..353c79d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/vectorEffect.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('vector-effect', v); + }, + get: function () { + return this.getPropertyValue('vector-effect'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/verticalAlign.js b/node_modules/cssstyle/lib/properties/verticalAlign.js new file mode 100644 index 0000000..a0dbd66 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/verticalAlign.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('vertical-align', v); + }, + get: function () { + return this.getPropertyValue('vertical-align'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/visibility.js b/node_modules/cssstyle/lib/properties/visibility.js new file mode 100644 index 0000000..08a2a6f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/visibility.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('visibility', v); + }, + get: function () { + return this.getPropertyValue('visibility'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/voiceFamily.js b/node_modules/cssstyle/lib/properties/voiceFamily.js new file mode 100644 index 0000000..b275aa4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/voiceFamily.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('voic-family', v); + }, + get: function () { + return this.getPropertyValue('voice-family'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/volume.js b/node_modules/cssstyle/lib/properties/volume.js new file mode 100644 index 0000000..422270e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/volume.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('volume', v); + }, + get: function () { + return this.getPropertyValue('volume'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitAnimation.js b/node_modules/cssstyle/lib/properties/webkitAnimation.js new file mode 100644 index 0000000..6a283a1 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitAnimation.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-animation', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitAnimationDelay.js b/node_modules/cssstyle/lib/properties/webkitAnimationDelay.js new file mode 100644 index 0000000..329484b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitAnimationDelay.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-animation-delay', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-delay'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitAnimationDirection.js b/node_modules/cssstyle/lib/properties/webkitAnimationDirection.js new file mode 100644 index 0000000..9bc92d9 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitAnimationDirection.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-animation-direction', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-direction'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitAnimationDuration.js b/node_modules/cssstyle/lib/properties/webkitAnimationDuration.js new file mode 100644 index 0000000..be36b9d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitAnimationDuration.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-animation-duration', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-duration'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitAnimationFillMode.js b/node_modules/cssstyle/lib/properties/webkitAnimationFillMode.js new file mode 100644 index 0000000..1a23ac0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitAnimationFillMode.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-animation-fill-mode', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-fill-mode'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitAnimationIterationCount.js b/node_modules/cssstyle/lib/properties/webkitAnimationIterationCount.js new file mode 100644 index 0000000..af37315 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitAnimationIterationCount.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-animation-iteration-count', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-iteration-count'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitAnimationName.js b/node_modules/cssstyle/lib/properties/webkitAnimationName.js new file mode 100644 index 0000000..8358409 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitAnimationName.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-animation-name', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-name'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitAnimationPlayState.js b/node_modules/cssstyle/lib/properties/webkitAnimationPlayState.js new file mode 100644 index 0000000..9ee0eb4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitAnimationPlayState.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-animation-play-state', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-play-state'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitAnimationTimingFunction.js b/node_modules/cssstyle/lib/properties/webkitAnimationTimingFunction.js new file mode 100644 index 0000000..e9eeb1e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitAnimationTimingFunction.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-animation-timing-function', v); + }, + get: function () { + return this.getPropertyValue('-webkit-animation-timing-function'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitAppearance.js b/node_modules/cssstyle/lib/properties/webkitAppearance.js new file mode 100644 index 0000000..6387fa2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitAppearance.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-appearance', v); + }, + get: function () { + return this.getPropertyValue('-webkit-appearance'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitAspectRatio.js b/node_modules/cssstyle/lib/properties/webkitAspectRatio.js new file mode 100644 index 0000000..c4271c7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitAspectRatio.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-aspect-ratio', v); + }, + get: function () { + return this.getPropertyValue('-webkit-aspect-ratio'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBackfaceVisibility.js b/node_modules/cssstyle/lib/properties/webkitBackfaceVisibility.js new file mode 100644 index 0000000..074a11d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBackfaceVisibility.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-backface-visibility', v); + }, + get: function () { + return this.getPropertyValue('-webkit-backface-visibility'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBackgroundClip.js b/node_modules/cssstyle/lib/properties/webkitBackgroundClip.js new file mode 100644 index 0000000..7a0f017 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBackgroundClip.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-background-clip', v); + }, + get: function () { + return this.getPropertyValue('-webkit-background-clip'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBackgroundComposite.js b/node_modules/cssstyle/lib/properties/webkitBackgroundComposite.js new file mode 100644 index 0000000..530a6fa --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBackgroundComposite.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-background-composite', v); + }, + get: function () { + return this.getPropertyValue('-webkit-background-composite'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBackgroundOrigin.js b/node_modules/cssstyle/lib/properties/webkitBackgroundOrigin.js new file mode 100644 index 0000000..799e930 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBackgroundOrigin.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-background-origin', v); + }, + get: function () { + return this.getPropertyValue('-webkit-background-origin'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBackgroundSize.js b/node_modules/cssstyle/lib/properties/webkitBackgroundSize.js new file mode 100644 index 0000000..ea3ed26 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBackgroundSize.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-background-size', v); + }, + get: function () { + return this.getPropertyValue('-webkit-background-size'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderAfter.js b/node_modules/cssstyle/lib/properties/webkitBorderAfter.js new file mode 100644 index 0000000..5d7fd61 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderAfter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-after'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderAfterColor.js b/node_modules/cssstyle/lib/properties/webkitBorderAfterColor.js new file mode 100644 index 0000000..d967ce6 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderAfterColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-after-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-border-after-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderAfterStyle.js b/node_modules/cssstyle/lib/properties/webkitBorderAfterStyle.js new file mode 100644 index 0000000..7e8f2bb --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderAfterStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-after-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-after-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderAfterWidth.js b/node_modules/cssstyle/lib/properties/webkitBorderAfterWidth.js new file mode 100644 index 0000000..eb2d344 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderAfterWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-after-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-after-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderBefore.js b/node_modules/cssstyle/lib/properties/webkitBorderBefore.js new file mode 100644 index 0000000..22f881b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderBefore.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-before'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderBeforeColor.js b/node_modules/cssstyle/lib/properties/webkitBorderBeforeColor.js new file mode 100644 index 0000000..f259ab2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderBeforeColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-before-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-border-before-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderBeforeStyle.js b/node_modules/cssstyle/lib/properties/webkitBorderBeforeStyle.js new file mode 100644 index 0000000..b2b57ad --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderBeforeStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-before-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-before-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderBeforeWidth.js b/node_modules/cssstyle/lib/properties/webkitBorderBeforeWidth.js new file mode 100644 index 0000000..aed2f9c --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderBeforeWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-before-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-before-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderEnd.js b/node_modules/cssstyle/lib/properties/webkitBorderEnd.js new file mode 100644 index 0000000..3744f98 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderEnd.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-end', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-end'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderEndColor.js b/node_modules/cssstyle/lib/properties/webkitBorderEndColor.js new file mode 100644 index 0000000..421d80b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderEndColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-end-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-border-end-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderEndStyle.js b/node_modules/cssstyle/lib/properties/webkitBorderEndStyle.js new file mode 100644 index 0000000..31648ea --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderEndStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-end-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-end-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderEndWidth.js b/node_modules/cssstyle/lib/properties/webkitBorderEndWidth.js new file mode 100644 index 0000000..948a9aa --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderEndWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-end-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-end-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderFit.js b/node_modules/cssstyle/lib/properties/webkitBorderFit.js new file mode 100644 index 0000000..81eaf70 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderFit.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-fit', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-fit'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderHorizontalSpacing.js b/node_modules/cssstyle/lib/properties/webkitBorderHorizontalSpacing.js new file mode 100644 index 0000000..73cbd2f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderHorizontalSpacing.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-horizontal-spacing', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-horizontal-spacing'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderImage.js b/node_modules/cssstyle/lib/properties/webkitBorderImage.js new file mode 100644 index 0000000..9ea9214 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderImage.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-image', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-image'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderRadius.js b/node_modules/cssstyle/lib/properties/webkitBorderRadius.js new file mode 100644 index 0000000..af8a6dd --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderRadius.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-radius', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-radius'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderStart.js b/node_modules/cssstyle/lib/properties/webkitBorderStart.js new file mode 100644 index 0000000..0a415d9 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderStart.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-start', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-start'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderStartColor.js b/node_modules/cssstyle/lib/properties/webkitBorderStartColor.js new file mode 100644 index 0000000..c6fd7c4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderStartColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-start-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-border-start-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderStartStyle.js b/node_modules/cssstyle/lib/properties/webkitBorderStartStyle.js new file mode 100644 index 0000000..74a666a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderStartStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-start-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-start-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderStartWidth.js b/node_modules/cssstyle/lib/properties/webkitBorderStartWidth.js new file mode 100644 index 0000000..cf5cb1f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderStartWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-start-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-start-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBorderVerticalSpacing.js b/node_modules/cssstyle/lib/properties/webkitBorderVerticalSpacing.js new file mode 100644 index 0000000..7d96425 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBorderVerticalSpacing.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-border-vertical-spacing', v); + }, + get: function () { + return this.getPropertyValue('-webkit-border-vertical-spacing'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBoxAlign.js b/node_modules/cssstyle/lib/properties/webkitBoxAlign.js new file mode 100644 index 0000000..c5483b5 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBoxAlign.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-box-align', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-align'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBoxDirection.js b/node_modules/cssstyle/lib/properties/webkitBoxDirection.js new file mode 100644 index 0000000..0aad038 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBoxDirection.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-box-direction', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-direction'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBoxFlex.js b/node_modules/cssstyle/lib/properties/webkitBoxFlex.js new file mode 100644 index 0000000..510fb58 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBoxFlex.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-box-flex', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-flex'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBoxFlexGroup.js b/node_modules/cssstyle/lib/properties/webkitBoxFlexGroup.js new file mode 100644 index 0000000..94dd158 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBoxFlexGroup.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-box-flex-group', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-flex-group'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBoxLines.js b/node_modules/cssstyle/lib/properties/webkitBoxLines.js new file mode 100644 index 0000000..4ba077c --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBoxLines.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-box-lines', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-lines'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBoxOrdinalGroup.js b/node_modules/cssstyle/lib/properties/webkitBoxOrdinalGroup.js new file mode 100644 index 0000000..fc1705d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBoxOrdinalGroup.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-box-ordinal-group', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-ordinal-group'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBoxOrient.js b/node_modules/cssstyle/lib/properties/webkitBoxOrient.js new file mode 100644 index 0000000..930d183 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBoxOrient.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-box-orient', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-orient'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBoxPack.js b/node_modules/cssstyle/lib/properties/webkitBoxPack.js new file mode 100644 index 0000000..0fa82d4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBoxPack.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-box-pack', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-pack'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBoxReflect.js b/node_modules/cssstyle/lib/properties/webkitBoxReflect.js new file mode 100644 index 0000000..0efc0fc --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBoxReflect.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-box-reflect', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-reflect'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitBoxShadow.js b/node_modules/cssstyle/lib/properties/webkitBoxShadow.js new file mode 100644 index 0000000..9a25857 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitBoxShadow.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-box-shadow', v); + }, + get: function () { + return this.getPropertyValue('-webkit-box-shadow'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColorCorrection.js b/node_modules/cssstyle/lib/properties/webkitColorCorrection.js new file mode 100644 index 0000000..c53d360 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColorCorrection.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-color-correction', v); + }, + get: function () { + return this.getPropertyValue('-webkit-color-correction'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnAxis.js b/node_modules/cssstyle/lib/properties/webkitColumnAxis.js new file mode 100644 index 0000000..6e32388 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnAxis.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-axis', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-axis'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnBreakAfter.js b/node_modules/cssstyle/lib/properties/webkitColumnBreakAfter.js new file mode 100644 index 0000000..640af1d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnBreakAfter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-break-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-break-after'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnBreakBefore.js b/node_modules/cssstyle/lib/properties/webkitColumnBreakBefore.js new file mode 100644 index 0000000..ef82ede --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnBreakBefore.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-break-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-break-before'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnBreakInside.js b/node_modules/cssstyle/lib/properties/webkitColumnBreakInside.js new file mode 100644 index 0000000..a300301 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnBreakInside.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-break-inside', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-break-inside'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnCount.js b/node_modules/cssstyle/lib/properties/webkitColumnCount.js new file mode 100644 index 0000000..513d5f7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnCount.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-count', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-count'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnGap.js b/node_modules/cssstyle/lib/properties/webkitColumnGap.js new file mode 100644 index 0000000..4e18e6b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnGap.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-gap', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-gap'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnRule.js b/node_modules/cssstyle/lib/properties/webkitColumnRule.js new file mode 100644 index 0000000..e7eb990 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnRule.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-rule', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-rule'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnRuleColor.js b/node_modules/cssstyle/lib/properties/webkitColumnRuleColor.js new file mode 100644 index 0000000..e5ea7a2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnRuleColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-rule-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-column-rule-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnRuleStyle.js b/node_modules/cssstyle/lib/properties/webkitColumnRuleStyle.js new file mode 100644 index 0000000..d72fd8c --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnRuleStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-rule-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-rule-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnRuleWidth.js b/node_modules/cssstyle/lib/properties/webkitColumnRuleWidth.js new file mode 100644 index 0000000..c8da6f4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnRuleWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-rule-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-rule-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnSpan.js b/node_modules/cssstyle/lib/properties/webkitColumnSpan.js new file mode 100644 index 0000000..a881a6c --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnSpan.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-span', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-span'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumnWidth.js b/node_modules/cssstyle/lib/properties/webkitColumnWidth.js new file mode 100644 index 0000000..7bc231f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumnWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-column-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-column-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitColumns.js b/node_modules/cssstyle/lib/properties/webkitColumns.js new file mode 100644 index 0000000..9381098 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitColumns.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-columns', v); + }, + get: function () { + return this.getPropertyValue('-webkit-columns'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFilter.js b/node_modules/cssstyle/lib/properties/webkitFilter.js new file mode 100644 index 0000000..7c81be0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFilter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-filter', v); + }, + get: function () { + return this.getPropertyValue('-webkit-filter'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFlexAlign.js b/node_modules/cssstyle/lib/properties/webkitFlexAlign.js new file mode 100644 index 0000000..c55e282 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFlexAlign.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-flex-align', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-align'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFlexDirection.js b/node_modules/cssstyle/lib/properties/webkitFlexDirection.js new file mode 100644 index 0000000..3dd5807 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFlexDirection.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-flex-direction', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-direction'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFlexFlow.js b/node_modules/cssstyle/lib/properties/webkitFlexFlow.js new file mode 100644 index 0000000..aa9da48 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFlexFlow.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-flex-flow', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-flow'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFlexItemAlign.js b/node_modules/cssstyle/lib/properties/webkitFlexItemAlign.js new file mode 100644 index 0000000..cbf8b8f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFlexItemAlign.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-flex-item-align', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-item-align'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFlexLinePack.js b/node_modules/cssstyle/lib/properties/webkitFlexLinePack.js new file mode 100644 index 0000000..78b528e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFlexLinePack.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-flex-line-pack', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-line-pack'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFlexOrder.js b/node_modules/cssstyle/lib/properties/webkitFlexOrder.js new file mode 100644 index 0000000..7f77aec --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFlexOrder.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-flex-order', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-order'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFlexPack.js b/node_modules/cssstyle/lib/properties/webkitFlexPack.js new file mode 100644 index 0000000..6636612 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFlexPack.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-flex-pack', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-pack'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFlexWrap.js b/node_modules/cssstyle/lib/properties/webkitFlexWrap.js new file mode 100644 index 0000000..4d03ec6 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFlexWrap.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-flex-wrap', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flex-wrap'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFlowFrom.js b/node_modules/cssstyle/lib/properties/webkitFlowFrom.js new file mode 100644 index 0000000..0f60e76 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFlowFrom.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-flow-from', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flow-from'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFlowInto.js b/node_modules/cssstyle/lib/properties/webkitFlowInto.js new file mode 100644 index 0000000..7ea20bd --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFlowInto.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-flow-into', v); + }, + get: function () { + return this.getPropertyValue('-webkit-flow-into'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFontFeatureSettings.js b/node_modules/cssstyle/lib/properties/webkitFontFeatureSettings.js new file mode 100644 index 0000000..c83f4b8 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFontFeatureSettings.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-font-feature-settings', v); + }, + get: function () { + return this.getPropertyValue('-webkit-font-feature-settings'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFontKerning.js b/node_modules/cssstyle/lib/properties/webkitFontKerning.js new file mode 100644 index 0000000..eba2339 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFontKerning.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-font-kerning', v); + }, + get: function () { + return this.getPropertyValue('-webkit-font-kerning'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFontSizeDelta.js b/node_modules/cssstyle/lib/properties/webkitFontSizeDelta.js new file mode 100644 index 0000000..89aaca5 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFontSizeDelta.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-font-size-delta', v); + }, + get: function () { + return this.getPropertyValue('-webkit-font-size-delta'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFontSmoothing.js b/node_modules/cssstyle/lib/properties/webkitFontSmoothing.js new file mode 100644 index 0000000..c3dc1ab --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFontSmoothing.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-font-smoothing', v); + }, + get: function () { + return this.getPropertyValue('-webkit-font-smoothing'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitFontVariantLigatures.js b/node_modules/cssstyle/lib/properties/webkitFontVariantLigatures.js new file mode 100644 index 0000000..79f07e4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitFontVariantLigatures.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-font-variant-ligatures', v); + }, + get: function () { + return this.getPropertyValue('-webkit-font-variant-ligatures'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitHighlight.js b/node_modules/cssstyle/lib/properties/webkitHighlight.js new file mode 100644 index 0000000..355d8f2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitHighlight.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-highlight', v); + }, + get: function () { + return this.getPropertyValue('-webkit-highlight'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitHyphenateCharacter.js b/node_modules/cssstyle/lib/properties/webkitHyphenateCharacter.js new file mode 100644 index 0000000..287473f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitHyphenateCharacter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-hyphenate-character', v); + }, + get: function () { + return this.getPropertyValue('-webkit-hyphenate-character'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitHyphenateLimitAfter.js b/node_modules/cssstyle/lib/properties/webkitHyphenateLimitAfter.js new file mode 100644 index 0000000..a20a859 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitHyphenateLimitAfter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-hyphenate-limit-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-hyphenate-limit-after'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitHyphenateLimitBefore.js b/node_modules/cssstyle/lib/properties/webkitHyphenateLimitBefore.js new file mode 100644 index 0000000..8fc1c2d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitHyphenateLimitBefore.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-hyphenate-limit-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-hyphenate-limit-before'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitHyphenateLimitLines.js b/node_modules/cssstyle/lib/properties/webkitHyphenateLimitLines.js new file mode 100644 index 0000000..c145b1d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitHyphenateLimitLines.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-hyphenate-limit-lines', v); + }, + get: function () { + return this.getPropertyValue('-webkit-hyphenate-limit-lines'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitHyphens.js b/node_modules/cssstyle/lib/properties/webkitHyphens.js new file mode 100644 index 0000000..3dfe9a7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitHyphens.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-hyphens', v); + }, + get: function () { + return this.getPropertyValue('-webkit-hyphens'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitLineAlign.js b/node_modules/cssstyle/lib/properties/webkitLineAlign.js new file mode 100644 index 0000000..1246968 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitLineAlign.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-line-align', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-align'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitLineBoxContain.js b/node_modules/cssstyle/lib/properties/webkitLineBoxContain.js new file mode 100644 index 0000000..492d9fa --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitLineBoxContain.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-line-box-contain', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-box-contain'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitLineBreak.js b/node_modules/cssstyle/lib/properties/webkitLineBreak.js new file mode 100644 index 0000000..3a6737e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitLineBreak.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-line-break', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-break'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitLineClamp.js b/node_modules/cssstyle/lib/properties/webkitLineClamp.js new file mode 100644 index 0000000..43d09f9 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitLineClamp.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-line-clamp', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-clamp'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitLineGrid.js b/node_modules/cssstyle/lib/properties/webkitLineGrid.js new file mode 100644 index 0000000..427351f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitLineGrid.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-line-grid', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-grid'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitLineSnap.js b/node_modules/cssstyle/lib/properties/webkitLineSnap.js new file mode 100644 index 0000000..3c49780 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitLineSnap.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-line-snap', v); + }, + get: function () { + return this.getPropertyValue('-webkit-line-snap'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitLocale.js b/node_modules/cssstyle/lib/properties/webkitLocale.js new file mode 100644 index 0000000..fba69d1 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitLocale.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-locale', v); + }, + get: function () { + return this.getPropertyValue('-webkit-locale'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitLogicalHeight.js b/node_modules/cssstyle/lib/properties/webkitLogicalHeight.js new file mode 100644 index 0000000..be3cfa0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitLogicalHeight.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-logical-height', v); + }, + get: function () { + return this.getPropertyValue('-webkit-logical-height'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitLogicalWidth.js b/node_modules/cssstyle/lib/properties/webkitLogicalWidth.js new file mode 100644 index 0000000..14efe8a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitLogicalWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-logical-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-logical-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarginAfter.js b/node_modules/cssstyle/lib/properties/webkitMarginAfter.js new file mode 100644 index 0000000..9efa007 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarginAfter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-margin-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-after'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarginAfterCollapse.js b/node_modules/cssstyle/lib/properties/webkitMarginAfterCollapse.js new file mode 100644 index 0000000..f7a3bdf --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarginAfterCollapse.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-margin-after-collapse', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-after-collapse'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarginBefore.js b/node_modules/cssstyle/lib/properties/webkitMarginBefore.js new file mode 100644 index 0000000..8324cc7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarginBefore.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-margin-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-before'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarginBeforeCollapse.js b/node_modules/cssstyle/lib/properties/webkitMarginBeforeCollapse.js new file mode 100644 index 0000000..5d8b04f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarginBeforeCollapse.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-margin-before-collapse', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-before-collapse'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarginBottomCollapse.js b/node_modules/cssstyle/lib/properties/webkitMarginBottomCollapse.js new file mode 100644 index 0000000..749eb22 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarginBottomCollapse.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-margin-bottom-collapse', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-bottom-collapse'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarginCollapse.js b/node_modules/cssstyle/lib/properties/webkitMarginCollapse.js new file mode 100644 index 0000000..71442e0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarginCollapse.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-margin-collapse', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-collapse'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarginEnd.js b/node_modules/cssstyle/lib/properties/webkitMarginEnd.js new file mode 100644 index 0000000..1994ed7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarginEnd.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-margin-end', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-end'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarginStart.js b/node_modules/cssstyle/lib/properties/webkitMarginStart.js new file mode 100644 index 0000000..6c348f6 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarginStart.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-margin-start', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-start'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarginTopCollapse.js b/node_modules/cssstyle/lib/properties/webkitMarginTopCollapse.js new file mode 100644 index 0000000..9325fca --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarginTopCollapse.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-margin-top-collapse', v); + }, + get: function () { + return this.getPropertyValue('-webkit-margin-top-collapse'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarquee.js b/node_modules/cssstyle/lib/properties/webkitMarquee.js new file mode 100644 index 0000000..dc1d99f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarquee.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-marquee', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarqueeDirection.js b/node_modules/cssstyle/lib/properties/webkitMarqueeDirection.js new file mode 100644 index 0000000..1f73245 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarqueeDirection.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-marquee-direction', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee-direction'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarqueeIncrement.js b/node_modules/cssstyle/lib/properties/webkitMarqueeIncrement.js new file mode 100644 index 0000000..9ae4a5d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarqueeIncrement.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-marquee-increment', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee-increment'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarqueeRepetition.js b/node_modules/cssstyle/lib/properties/webkitMarqueeRepetition.js new file mode 100644 index 0000000..f718ced --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarqueeRepetition.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-marquee-repetition', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee-repetition'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarqueeSpeed.js b/node_modules/cssstyle/lib/properties/webkitMarqueeSpeed.js new file mode 100644 index 0000000..99dbad7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarqueeSpeed.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-marquee-speed', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee-speed'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMarqueeStyle.js b/node_modules/cssstyle/lib/properties/webkitMarqueeStyle.js new file mode 100644 index 0000000..9bd0631 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMarqueeStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-marquee-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-marquee-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMask.js b/node_modules/cssstyle/lib/properties/webkitMask.js new file mode 100644 index 0000000..6a9603c --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMask.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskAttachment.js b/node_modules/cssstyle/lib/properties/webkitMaskAttachment.js new file mode 100644 index 0000000..bc5ea46 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskAttachment.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-attachment', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-attachment'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskBoxImage.js b/node_modules/cssstyle/lib/properties/webkitMaskBoxImage.js new file mode 100644 index 0000000..93955a6 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskBoxImage.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskBoxImageOutset.js b/node_modules/cssstyle/lib/properties/webkitMaskBoxImageOutset.js new file mode 100644 index 0000000..d539302 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskBoxImageOutset.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image-outset', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image-outset'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskBoxImageRepeat.js b/node_modules/cssstyle/lib/properties/webkitMaskBoxImageRepeat.js new file mode 100644 index 0000000..3a02cf6 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskBoxImageRepeat.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image-repeat', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image-repeat'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskBoxImageSlice.js b/node_modules/cssstyle/lib/properties/webkitMaskBoxImageSlice.js new file mode 100644 index 0000000..7bb49e7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskBoxImageSlice.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image-slice', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image-slice'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskBoxImageSource.js b/node_modules/cssstyle/lib/properties/webkitMaskBoxImageSource.js new file mode 100644 index 0000000..9508871 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskBoxImageSource.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image-source', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image-source'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskBoxImageWidth.js b/node_modules/cssstyle/lib/properties/webkitMaskBoxImageWidth.js new file mode 100644 index 0000000..f500bbb --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskBoxImageWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-box-image-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-box-image-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskClip.js b/node_modules/cssstyle/lib/properties/webkitMaskClip.js new file mode 100644 index 0000000..4140c1e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskClip.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-clip', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-clip'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskComposite.js b/node_modules/cssstyle/lib/properties/webkitMaskComposite.js new file mode 100644 index 0000000..88fedab --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskComposite.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-composite', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-composite'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskImage.js b/node_modules/cssstyle/lib/properties/webkitMaskImage.js new file mode 100644 index 0000000..8155e71 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskImage.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-image', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-image'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskOrigin.js b/node_modules/cssstyle/lib/properties/webkitMaskOrigin.js new file mode 100644 index 0000000..9eb2c5a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskOrigin.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-origin', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-origin'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskPosition.js b/node_modules/cssstyle/lib/properties/webkitMaskPosition.js new file mode 100644 index 0000000..a0c228c --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskPosition.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-position', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-position'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskPositionX.js b/node_modules/cssstyle/lib/properties/webkitMaskPositionX.js new file mode 100644 index 0000000..6aae1d2 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskPositionX.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-position-x', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-position-x'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskPositionY.js b/node_modules/cssstyle/lib/properties/webkitMaskPositionY.js new file mode 100644 index 0000000..3dd7dbc --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskPositionY.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-position-y', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-position-y'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskRepeat.js b/node_modules/cssstyle/lib/properties/webkitMaskRepeat.js new file mode 100644 index 0000000..ef66b66 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskRepeat.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-repeat', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-repeat'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskRepeatX.js b/node_modules/cssstyle/lib/properties/webkitMaskRepeatX.js new file mode 100644 index 0000000..35f47d8 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskRepeatX.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-repeat-x', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-repeat-x'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskRepeatY.js b/node_modules/cssstyle/lib/properties/webkitMaskRepeatY.js new file mode 100644 index 0000000..8c743c0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskRepeatY.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-repeat-y', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-repeat-y'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaskSize.js b/node_modules/cssstyle/lib/properties/webkitMaskSize.js new file mode 100644 index 0000000..3327343 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaskSize.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-mask-size', v); + }, + get: function () { + return this.getPropertyValue('-webkit-mask-size'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMatchNearestMailBlockquoteColor.js b/node_modules/cssstyle/lib/properties/webkitMatchNearestMailBlockquoteColor.js new file mode 100644 index 0000000..c4a2153 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMatchNearestMailBlockquoteColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-match-nearest-mail-blockquote-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-match-nearest-mail-blockquote-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaxLogicalHeight.js b/node_modules/cssstyle/lib/properties/webkitMaxLogicalHeight.js new file mode 100644 index 0000000..97a293d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaxLogicalHeight.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-max-logical-height', v); + }, + get: function () { + return this.getPropertyValue('-webkit-max-logical-height'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMaxLogicalWidth.js b/node_modules/cssstyle/lib/properties/webkitMaxLogicalWidth.js new file mode 100644 index 0000000..f746b72 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMaxLogicalWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-max-logical-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-max-logical-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMinLogicalHeight.js b/node_modules/cssstyle/lib/properties/webkitMinLogicalHeight.js new file mode 100644 index 0000000..948b899 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMinLogicalHeight.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-min-logical-height', v); + }, + get: function () { + return this.getPropertyValue('-webkit-min-logical-height'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitMinLogicalWidth.js b/node_modules/cssstyle/lib/properties/webkitMinLogicalWidth.js new file mode 100644 index 0000000..eb990b0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitMinLogicalWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-min-logical-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-min-logical-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitNbspMode.js b/node_modules/cssstyle/lib/properties/webkitNbspMode.js new file mode 100644 index 0000000..1d93619 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitNbspMode.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-nbsp-mode', v); + }, + get: function () { + return this.getPropertyValue('-webkit-nbsp-mode'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitOverflowScrolling.js b/node_modules/cssstyle/lib/properties/webkitOverflowScrolling.js new file mode 100644 index 0000000..7ba9e57 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitOverflowScrolling.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-overflow-scrolling', v); + }, + get: function () { + return this.getPropertyValue('-webkit-overflow-scrolling'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitPaddingAfter.js b/node_modules/cssstyle/lib/properties/webkitPaddingAfter.js new file mode 100644 index 0000000..033cde8 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitPaddingAfter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-padding-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-padding-after'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitPaddingBefore.js b/node_modules/cssstyle/lib/properties/webkitPaddingBefore.js new file mode 100644 index 0000000..04e3796 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitPaddingBefore.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-padding-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-padding-before'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitPaddingEnd.js b/node_modules/cssstyle/lib/properties/webkitPaddingEnd.js new file mode 100644 index 0000000..1677ebc --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitPaddingEnd.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-padding-end', v); + }, + get: function () { + return this.getPropertyValue('-webkit-padding-end'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitPaddingStart.js b/node_modules/cssstyle/lib/properties/webkitPaddingStart.js new file mode 100644 index 0000000..1c89a92 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitPaddingStart.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-padding-start', v); + }, + get: function () { + return this.getPropertyValue('-webkit-padding-start'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitPerspective.js b/node_modules/cssstyle/lib/properties/webkitPerspective.js new file mode 100644 index 0000000..9544932 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitPerspective.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-perspective', v); + }, + get: function () { + return this.getPropertyValue('-webkit-perspective'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitPerspectiveOrigin.js b/node_modules/cssstyle/lib/properties/webkitPerspectiveOrigin.js new file mode 100644 index 0000000..f6531f1 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitPerspectiveOrigin.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-perspective-origin', v); + }, + get: function () { + return this.getPropertyValue('-webkit-perspective-origin'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitPerspectiveOriginX.js b/node_modules/cssstyle/lib/properties/webkitPerspectiveOriginX.js new file mode 100644 index 0000000..5cc28a4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitPerspectiveOriginX.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-perspective-origin-x', v); + }, + get: function () { + return this.getPropertyValue('-webkit-perspective-origin-x'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitPerspectiveOriginY.js b/node_modules/cssstyle/lib/properties/webkitPerspectiveOriginY.js new file mode 100644 index 0000000..05d5393 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitPerspectiveOriginY.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-perspective-origin-y', v); + }, + get: function () { + return this.getPropertyValue('-webkit-perspective-origin-y'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitPrintColorAdjust.js b/node_modules/cssstyle/lib/properties/webkitPrintColorAdjust.js new file mode 100644 index 0000000..9254283 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitPrintColorAdjust.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-print-color-adjust', v); + }, + get: function () { + return this.getPropertyValue('-webkit-print-color-adjust'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitRegionBreakAfter.js b/node_modules/cssstyle/lib/properties/webkitRegionBreakAfter.js new file mode 100644 index 0000000..27210e1 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitRegionBreakAfter.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-region-break-after', v); + }, + get: function () { + return this.getPropertyValue('-webkit-region-break-after'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitRegionBreakBefore.js b/node_modules/cssstyle/lib/properties/webkitRegionBreakBefore.js new file mode 100644 index 0000000..52d068f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitRegionBreakBefore.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-region-break-before', v); + }, + get: function () { + return this.getPropertyValue('-webkit-region-break-before'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitRegionBreakInside.js b/node_modules/cssstyle/lib/properties/webkitRegionBreakInside.js new file mode 100644 index 0000000..5adc8f7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitRegionBreakInside.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-region-break-inside', v); + }, + get: function () { + return this.getPropertyValue('-webkit-region-break-inside'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitRegionOverflow.js b/node_modules/cssstyle/lib/properties/webkitRegionOverflow.js new file mode 100644 index 0000000..730b0b4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitRegionOverflow.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-region-overflow', v); + }, + get: function () { + return this.getPropertyValue('-webkit-region-overflow'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitRtlOrdering.js b/node_modules/cssstyle/lib/properties/webkitRtlOrdering.js new file mode 100644 index 0000000..08c2b42 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitRtlOrdering.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-rtl-ordering', v); + }, + get: function () { + return this.getPropertyValue('-webkit-rtl-ordering'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitSvgShadow.js b/node_modules/cssstyle/lib/properties/webkitSvgShadow.js new file mode 100644 index 0000000..33fccf4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitSvgShadow.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-svg-shadow', v); + }, + get: function () { + return this.getPropertyValue('-webkit-svg-shadow'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTapHighlightColor.js b/node_modules/cssstyle/lib/properties/webkitTapHighlightColor.js new file mode 100644 index 0000000..9510b78 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTapHighlightColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-tap-highlight-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-tap-highlight-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextCombine.js b/node_modules/cssstyle/lib/properties/webkitTextCombine.js new file mode 100644 index 0000000..aab7223 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextCombine.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-combine', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-combine'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextDecorationsInEffect.js b/node_modules/cssstyle/lib/properties/webkitTextDecorationsInEffect.js new file mode 100644 index 0000000..f6defb0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextDecorationsInEffect.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-decorations-in-effect', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-decorations-in-effect'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextEmphasis.js b/node_modules/cssstyle/lib/properties/webkitTextEmphasis.js new file mode 100644 index 0000000..b7523dc --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextEmphasis.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-emphasis', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-emphasis'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextEmphasisColor.js b/node_modules/cssstyle/lib/properties/webkitTextEmphasisColor.js new file mode 100644 index 0000000..14b269f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextEmphasisColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-emphasis-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-text-emphasis-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextEmphasisPosition.js b/node_modules/cssstyle/lib/properties/webkitTextEmphasisPosition.js new file mode 100644 index 0000000..2a1cc25 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextEmphasisPosition.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-emphasis-position', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-emphasis-position'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextEmphasisStyle.js b/node_modules/cssstyle/lib/properties/webkitTextEmphasisStyle.js new file mode 100644 index 0000000..69f3e5a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextEmphasisStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-emphasis-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-emphasis-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextFillColor.js b/node_modules/cssstyle/lib/properties/webkitTextFillColor.js new file mode 100644 index 0000000..1d0981d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextFillColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-fill-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-text-fill-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextOrientation.js b/node_modules/cssstyle/lib/properties/webkitTextOrientation.js new file mode 100644 index 0000000..b43bfe8 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextOrientation.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-orientation', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-orientation'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextSecurity.js b/node_modules/cssstyle/lib/properties/webkitTextSecurity.js new file mode 100644 index 0000000..27cd712 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextSecurity.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-security', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-security'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextSizeAdjust.js b/node_modules/cssstyle/lib/properties/webkitTextSizeAdjust.js new file mode 100644 index 0000000..42a1769 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextSizeAdjust.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-size-adjust', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-size-adjust'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextStroke.js b/node_modules/cssstyle/lib/properties/webkitTextStroke.js new file mode 100644 index 0000000..95f08f0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextStroke.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-stroke', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-stroke'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextStrokeColor.js b/node_modules/cssstyle/lib/properties/webkitTextStrokeColor.js new file mode 100644 index 0000000..34aa180 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextStrokeColor.js @@ -0,0 +1,14 @@ +'use strict'; + +var parseColor = require('../parsers').parseColor; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-stroke-color', parseColor(v)); + }, + get: function () { + return this.getPropertyValue('-webkit-text-stroke-color'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTextStrokeWidth.js b/node_modules/cssstyle/lib/properties/webkitTextStrokeWidth.js new file mode 100644 index 0000000..9abdb0d --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTextStrokeWidth.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-text-stroke-width', v); + }, + get: function () { + return this.getPropertyValue('-webkit-text-stroke-width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTransform.js b/node_modules/cssstyle/lib/properties/webkitTransform.js new file mode 100644 index 0000000..55025d0 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTransform.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-transform', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTransformOrigin.js b/node_modules/cssstyle/lib/properties/webkitTransformOrigin.js new file mode 100644 index 0000000..17f2470 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTransformOrigin.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-transform-origin', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform-origin'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTransformOriginX.js b/node_modules/cssstyle/lib/properties/webkitTransformOriginX.js new file mode 100644 index 0000000..27f356c --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTransformOriginX.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-transform-origin-x', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform-origin-x'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTransformOriginY.js b/node_modules/cssstyle/lib/properties/webkitTransformOriginY.js new file mode 100644 index 0000000..cd9fe41 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTransformOriginY.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-transform-origin-y', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform-origin-y'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTransformOriginZ.js b/node_modules/cssstyle/lib/properties/webkitTransformOriginZ.js new file mode 100644 index 0000000..448a4c6 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTransformOriginZ.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-transform-origin-z', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform-origin-z'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTransformStyle.js b/node_modules/cssstyle/lib/properties/webkitTransformStyle.js new file mode 100644 index 0000000..7258af3 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTransformStyle.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-transform-style', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transform-style'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTransition.js b/node_modules/cssstyle/lib/properties/webkitTransition.js new file mode 100644 index 0000000..e8e611a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTransition.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-transition', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transition'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTransitionDelay.js b/node_modules/cssstyle/lib/properties/webkitTransitionDelay.js new file mode 100644 index 0000000..0e4a855 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTransitionDelay.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-transition-delay', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transition-delay'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTransitionDuration.js b/node_modules/cssstyle/lib/properties/webkitTransitionDuration.js new file mode 100644 index 0000000..916354e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTransitionDuration.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-transition-duration', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transition-duration'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTransitionProperty.js b/node_modules/cssstyle/lib/properties/webkitTransitionProperty.js new file mode 100644 index 0000000..2c05b93 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTransitionProperty.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-transition-property', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transition-property'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitTransitionTimingFunction.js b/node_modules/cssstyle/lib/properties/webkitTransitionTimingFunction.js new file mode 100644 index 0000000..6000a5a --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitTransitionTimingFunction.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-transition-timing-function', v); + }, + get: function () { + return this.getPropertyValue('-webkit-transition-timing-function'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitUserDrag.js b/node_modules/cssstyle/lib/properties/webkitUserDrag.js new file mode 100644 index 0000000..91979ce --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitUserDrag.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-user-drag', v); + }, + get: function () { + return this.getPropertyValue('-webkit-user-drag'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitUserModify.js b/node_modules/cssstyle/lib/properties/webkitUserModify.js new file mode 100644 index 0000000..f681902 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitUserModify.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-user-modify', v); + }, + get: function () { + return this.getPropertyValue('-webkit-user-modify'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitUserSelect.js b/node_modules/cssstyle/lib/properties/webkitUserSelect.js new file mode 100644 index 0000000..a33611f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitUserSelect.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-user-select', v); + }, + get: function () { + return this.getPropertyValue('-webkit-user-select'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitWrap.js b/node_modules/cssstyle/lib/properties/webkitWrap.js new file mode 100644 index 0000000..1861f67 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitWrap.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-wrap', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitWrapFlow.js b/node_modules/cssstyle/lib/properties/webkitWrapFlow.js new file mode 100644 index 0000000..f213f11 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitWrapFlow.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-wrap-flow', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-flow'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitWrapMargin.js b/node_modules/cssstyle/lib/properties/webkitWrapMargin.js new file mode 100644 index 0000000..27b6d57 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitWrapMargin.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-wrap-margin', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-margin'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitWrapPadding.js b/node_modules/cssstyle/lib/properties/webkitWrapPadding.js new file mode 100644 index 0000000..b408d5f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitWrapPadding.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-wrap-padding', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-padding'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitWrapShapeInside.js b/node_modules/cssstyle/lib/properties/webkitWrapShapeInside.js new file mode 100644 index 0000000..52e04cc --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitWrapShapeInside.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-wrap-shape-inside', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-shape-inside'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitWrapShapeOutside.js b/node_modules/cssstyle/lib/properties/webkitWrapShapeOutside.js new file mode 100644 index 0000000..8bb0407 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitWrapShapeOutside.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-wrap-shape-outside', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-shape-outside'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitWrapThrough.js b/node_modules/cssstyle/lib/properties/webkitWrapThrough.js new file mode 100644 index 0000000..a6dc684 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitWrapThrough.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-wrap-through', v); + }, + get: function () { + return this.getPropertyValue('-webkit-wrap-through'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/webkitWritingMode.js b/node_modules/cssstyle/lib/properties/webkitWritingMode.js new file mode 100644 index 0000000..ef1b1f7 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/webkitWritingMode.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('-webkit-writing-mode', v); + }, + get: function () { + return this.getPropertyValue('-webkit-writing-mode'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/whiteSpace.js b/node_modules/cssstyle/lib/properties/whiteSpace.js new file mode 100644 index 0000000..969718f --- /dev/null +++ b/node_modules/cssstyle/lib/properties/whiteSpace.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('white-space', v); + }, + get: function () { + return this.getPropertyValue('white-space'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/widows.js b/node_modules/cssstyle/lib/properties/widows.js new file mode 100644 index 0000000..02b7298 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/widows.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('widows', v); + }, + get: function () { + return this.getPropertyValue('widows'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/width.js b/node_modules/cssstyle/lib/properties/width.js new file mode 100644 index 0000000..b64161e --- /dev/null +++ b/node_modules/cssstyle/lib/properties/width.js @@ -0,0 +1,24 @@ +'use strict'; + +var parseMeasurement = require('../parsers').parseMeasurement; + +function parse(v) { + if (String(v).toLowerCase() === 'auto') { + return 'auto'; + } + if (String(v).toLowerCase() === 'inherit') { + return 'inherit'; + } + return parseMeasurement(v); +} + +module.exports.definition = { + set: function (v) { + this._setProperty('width', parse(v)); + }, + get: function () { + return this.getPropertyValue('width'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/wordBreak.js b/node_modules/cssstyle/lib/properties/wordBreak.js new file mode 100644 index 0000000..568f19b --- /dev/null +++ b/node_modules/cssstyle/lib/properties/wordBreak.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('word-break', v); + }, + get: function () { + return this.getPropertyValue('word-break'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/wordSpacing.js b/node_modules/cssstyle/lib/properties/wordSpacing.js new file mode 100644 index 0000000..bfb77e4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/wordSpacing.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('word-spacing', v); + }, + get: function () { + return this.getPropertyValue('word-spacing'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/wordWrap.js b/node_modules/cssstyle/lib/properties/wordWrap.js new file mode 100644 index 0000000..f826c91 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/wordWrap.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('word-wrap', v); + }, + get: function () { + return this.getPropertyValue('word-wrap'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/writingMode.js b/node_modules/cssstyle/lib/properties/writingMode.js new file mode 100644 index 0000000..e5affa4 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/writingMode.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('writing-mode', v); + }, + get: function () { + return this.getPropertyValue('writing-mode'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/zIndex.js b/node_modules/cssstyle/lib/properties/zIndex.js new file mode 100644 index 0000000..3d81e08 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/zIndex.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('z-index', v); + }, + get: function () { + return this.getPropertyValue('z-index'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/lib/properties/zoom.js b/node_modules/cssstyle/lib/properties/zoom.js new file mode 100644 index 0000000..e563185 --- /dev/null +++ b/node_modules/cssstyle/lib/properties/zoom.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports.definition = { + set: function (v) { + this._setProperty('zoom', v); + }, + get: function () { + return this.getPropertyValue('zoom'); + }, + enumerable: true, + configurable: true +}; diff --git a/node_modules/cssstyle/package.json b/node_modules/cssstyle/package.json new file mode 100644 index 0000000..578317b --- /dev/null +++ b/node_modules/cssstyle/package.json @@ -0,0 +1,82 @@ +{ + "_from": "cssstyle@>= 0.2.37 < 0.3.0", + "_id": "cssstyle@0.2.37", + "_inBundle": false, + "_integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", + "_location": "/cssstyle", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "cssstyle@>= 0.2.37 < 0.3.0", + "name": "cssstyle", + "escapedName": "cssstyle", + "rawSpec": ">= 0.2.37 < 0.3.0", + "saveSpec": null, + "fetchSpec": ">= 0.2.37 < 0.3.0" + }, + "_requiredBy": [ + "/jsdom" + ], + "_resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", + "_shasum": "541097234cb2513c83ceed3acddc27ff27987d54", + "_spec": "cssstyle@>= 0.2.37 < 0.3.0", + "_where": "/home/s2/Documents/Code/minifyfromhtml/node_modules/jsdom", + "bugs": { + "url": "https://github.com/chad3814/CSSStyleDeclaration/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Nikita Vasilyev", + "email": "me@elv1s.ru" + }, + { + "name": "Davide P. Cervone" + }, + { + "name": "Forbes Lindesay" + } + ], + "dependencies": { + "cssom": "0.3.x" + }, + "deprecated": false, + "description": "CSSStyleDeclaration Object Model implementation", + "devDependencies": { + "babel-generator": "~6.11.4", + "babel-traverse": "~6.13.0", + "babel-types": "~6.13.0", + "babylon": "~6.8.4", + "nodeunit": "~0.8.0", + "resolve": "~1.1.7" + }, + "directories": { + "lib": "./lib" + }, + "homepage": "https://github.com/chad3814/CSSStyleDeclaration", + "keywords": [ + "CSS", + "CSSStyleDeclaration", + "StyleSheet" + ], + "license": "MIT", + "main": "./lib/CSSStyleDeclaration.js", + "maintainers": [ + { + "name": "Chad Walker", + "email": "chad@chad-cat-lore-eddie.com", + "url": "https://github.com/chad3814" + } + ], + "name": "cssstyle", + "repository": { + "type": "git", + "url": "git+https://github.com/chad3814/CSSStyleDeclaration.git" + }, + "scripts": { + "prepublish": "node ./scripts/generate_properties.js", + "test": "./scripts/run_tests.sh" + }, + "version": "0.2.37" +} diff --git a/node_modules/cssstyle/scripts/generate_properties.js b/node_modules/cssstyle/scripts/generate_properties.js new file mode 100644 index 0000000..b8c8afd --- /dev/null +++ b/node_modules/cssstyle/scripts/generate_properties.js @@ -0,0 +1,302 @@ +'use strict'; + +var fs = require('fs'); +var path = require('path'); +var babylon = require('babylon'); +var t = require('babel-types'); +var generate = require('babel-generator').default; +var traverse = require('babel-traverse').default; +var resolve = require('resolve'); + +var camelToDashed = require('../lib/parsers').camelToDashed; + +var basename = path.basename; +var dirname = path.dirname; + +var uniqueIndex = 0; +function getUniqueIndex() { + return uniqueIndex++; +} + +var property_files = fs.readdirSync(path.resolve(__dirname, '../lib/properties')).filter(function (property) { + return property.substr(-3) === '.js'; +}); +var out_file = fs.createWriteStream(path.resolve(__dirname, '../lib/properties.js'), {encoding: 'utf-8'}); + +out_file.write('\'use strict\';\n\n// autogenerated\n\n'); +out_file.write('/*\n *\n * http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties\n */\n\n'); + +function isModuleDotExports(node) { + return ( + t.isMemberExpression(node, {computed: false}) && + t.isIdentifier(node.object, {name: 'module'}) && + t.isIdentifier(node.property, {name: 'exports'}) + ); +} +function isRequire(node, filename) { + if ( + t.isCallExpression(node) && + t.isIdentifier(node.callee, {name: 'require'}) && + node.arguments.length === 1 && + t.isStringLiteral(node.arguments[0]) + ) { + var relative = node.arguments[0].value; + var fullPath = resolve.sync(relative, {basedir: dirname(filename)}); + return {relative: relative, fullPath: fullPath}; + } else { + return false; + } +} + +// step 1: parse all files and figure out their dependencies +var parsedFilesByPath = {}; +property_files.map(function (property) { + var filename = path.resolve(__dirname, '../lib/properties/' + property); + var src = fs.readFileSync(filename, 'utf8'); + property = basename(property, '.js'); + var ast = babylon.parse(src); + var dependencies = []; + traverse(ast, { + enter(path) { + var r; + if (r = isRequire(path.node, filename)) { + dependencies.push(r.fullPath); + } + } + }); + parsedFilesByPath[filename] = { + filename: filename, + property: property, + ast: ast, + dependencies: dependencies, + }; +}); + +// step 2: serialize the files in an order where dependencies are always above +// the files they depend on +var externalDependencies = []; +var parsedFiles = []; +var addedFiles = {}; +function addFile(filename, dependencyPath) { + if (dependencyPath.indexOf(filename) !== -1) { + throw new Error( + 'Circular dependency: ' + + dependencyPath.slice(dependencyPath.indexOf(filename)).concat([filename]).join(' -> ') + ); + } + var file = parsedFilesByPath[filename]; + if (addedFiles[filename]) { + return; + } + if (!file) { + externalDependencies.push(filename); + } else { + file.dependencies.forEach(function (dependency) { + addFile(dependency, dependencyPath.concat([filename])); + }); + parsedFiles.push(parsedFilesByPath[filename]); + } + addedFiles[filename] = true; +} +Object.keys(parsedFilesByPath).forEach(function (filename) { + addFile(filename, []); +}); +// Step 3: add files to output +// renaming exports to local variables `moduleName_export_exportName` +// and updating require calls as appropriate +var moduleExportsByPath = {}; +var statements = []; +externalDependencies.forEach(function (filename, i) { + var id = t.identifier( + 'external_dependency_' + + basename(filename, '.js').replace(/[^A-Za-z]/g, '') + + '_' + i + ); + moduleExportsByPath[filename] = {defaultExports: id}; + var relativePath = path.relative(path.resolve(__dirname + '/../lib'), filename); + if (relativePath[0] !== '.') { + relativePath = './' + relativePath; + } + statements.push(t.variableDeclaration( + 'var', + [ + t.variableDeclarator( + id, + t.callExpression( + t.identifier('require'), + [ + t.stringLiteral( + relativePath + ) + ] + ) + ) + ] + )); +}); +function getRequireValue(node, file) { + var r; + // replace require("./foo").bar with the named export from foo + if ( + t.isMemberExpression(node, {computed: false}) && + (r = isRequire(node.object, file.filename)) + ) { + var e = moduleExportsByPath[r.fullPath]; + if (!e) { + return; + } + if (!e.namedExports) { + return t.memberExpression( + e.defaultExports, + node.property + ); + } + if (!e.namedExports[node.property.name]) { + throw new Error(r.relative + ' does not export ' + node.property.name); + } + return e.namedExports[node.property.name]; + + // replace require("./foo") with the default export of foo + } else if (r = isRequire(node, file.filename)) { + var e = moduleExportsByPath[r.fullPath]; + if (!e) { + if (/^\.\.\//.test(r.relative)) { + node.arguments[0].value = r.relative.substr(1); + } + return; + } + return e.defaultExports; + } +} +parsedFiles.forEach(function (file) { + var namedExports = {}; + var localVariableMap = {}; + + traverse(file.ast, { + enter(path) { + // replace require calls with the corresponding value + var r; + if (r = getRequireValue(path.node, file)) { + path.replaceWith(r); + return; + } + + // if we see `var foo = require('bar')` we can just inline the variable + // representing `require('bar')` wherever `foo` was used. + if ( + t.isVariableDeclaration(path.node) && + path.node.declarations.length === 1 && + t.isIdentifier(path.node.declarations[0].id) && + (r = getRequireValue(path.node.declarations[0].init, file)) + ) { + var newName = 'compiled_local_variable_reference_' + getUniqueIndex(); + path.scope.rename( + path.node.declarations[0].id.name, + newName + ); + localVariableMap[newName] = r; + path.remove(); + return; + } + + // rename all top level variables to keep them local to the module + if ( + t.isVariableDeclaration(path.node) && + t.isProgram(path.parent) + ) { + path.node.declarations.forEach(function (declaration) { + path.scope.rename( + declaration.id.name, + file.property + '_local_var_' + declaration.id.name + ); + }); + return; + } + + // replace module.exports.bar with a variable for the named export + if ( + t.isMemberExpression(path.node, {computed: false}) && + isModuleDotExports(path.node.object) + ) { + var name = path.node.property.name; + var identifier = t.identifier(file.property + '_export_' + name); + path.replaceWith(identifier); + namedExports[name] = identifier; + } + } + }); + traverse(file.ast, { + enter(path) { + if ( + t.isIdentifier(path.node) && + Object.prototype.hasOwnProperty.call(localVariableMap, path.node.name) + ) { + path.replaceWith(localVariableMap[path.node.name]); + } + } + }); + var defaultExports = t.objectExpression(Object.keys(namedExports).map(function (name) { + return t.objectProperty(t.identifier(name), namedExports[name]); + })); + moduleExportsByPath[file.filename] = { + namedExports: namedExports, + defaultExports: defaultExports + }; + statements.push(t.variableDeclaration( + 'var', + Object.keys(namedExports).map(function (name) { + return t.variableDeclarator(namedExports[name]); + }) + )) + statements.push.apply(statements, file.ast.program.body); +}); +var propertyDefinitions = []; +parsedFiles.forEach(function (file) { + var dashed = camelToDashed(file.property); + propertyDefinitions.push( + t.objectProperty( + t.identifier(file.property), + t.identifier(file.property + '_export_definition') + ) + ); + if (file.property !== dashed) { + propertyDefinitions.push( + t.objectProperty( + t.stringLiteral(dashed), + t.identifier(file.property + '_export_definition') + ) + ); + } +}); +var definePropertiesCall = t.callExpression( + t.memberExpression( + t.identifier('Object'), + t.identifier('defineProperties') + ), + [ + t.identifier('prototype'), + t.objectExpression( + propertyDefinitions + ) + ] +); +statements.push(t.expressionStatement( + t.assignmentExpression( + '=', + t.memberExpression( + t.identifier('module'), + t.identifier('exports') + ), + t.functionExpression( + null, + [t.identifier('prototype')], + t.blockStatement([t.expressionStatement(definePropertiesCall)]) + ) + ) +)); +out_file.write(generate(t.program(statements)).code + '\n') +out_file.end(function (err) { + if (err) { + throw err; + } +}); diff --git a/node_modules/cssstyle/scripts/run_tests.sh b/node_modules/cssstyle/scripts/run_tests.sh new file mode 100755 index 0000000..dc32fc3 --- /dev/null +++ b/node_modules/cssstyle/scripts/run_tests.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +node ./scripts/generate_properties.js +nodeunit tests diff --git a/node_modules/cssstyle/tests/tests.js b/node_modules/cssstyle/tests/tests.js new file mode 100644 index 0000000..8227711 --- /dev/null +++ b/node_modules/cssstyle/tests/tests.js @@ -0,0 +1,405 @@ +"use strict"; +var util = require('util'); +var cssstyle = require('../lib/CSSStyleDeclaration'); + +var camelToDashed = require('../lib/parsers').camelToDashed; + +/** + * These are the required properties + * see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties + **/ +var properties = [ 'azimuth', 'background', 'backgroundAttachment', 'backgroundColor', 'backgroundImage', 'backgroundPosition', 'backgroundRepeat', 'border', 'borderCollapse', 'borderColor', 'borderSpacing', 'borderStyle', 'borderTop', 'borderRight', 'borderBottom', 'borderLeft', 'borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor', 'borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle', 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth', 'borderWidth', 'bottom', 'captionSide', 'clear', 'clip', 'color', 'content', 'counterIncrement', 'counterReset', 'cue', 'cueAfter', 'cueBefore', 'cursor', 'direction', 'display', 'elevation', 'emptyCells', 'cssFloat', 'font', 'fontFamily', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontWeight', 'height', 'left', 'letterSpacing', 'lineHeight', 'listStyle', 'listStyleImage', 'listStylePosition', 'listStyleType', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'markerOffset', 'marks', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'orphans', 'outline', 'outlineColor', 'outlineStyle', 'outlineWidth', 'overflow', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'page', 'pageBreakAfter', 'pageBreakBefore', 'pageBreakInside', 'pause', 'pauseAfter', 'pauseBefore', 'pitch', 'pitchRange', 'playDuring', 'position', 'quotes', 'richness', 'right', 'size', 'speak', 'speakHeader', 'speakNumeral', 'speakPunctuation', 'speechRate', 'stress', 'tableLayout', 'textAlign', 'textDecoration', 'textIndent', 'textShadow', 'textTransform', 'top', 'unicodeBidi', 'verticalAlign', 'visibility', 'voiceFamily', 'volume', 'whiteSpace', 'widows', 'width', 'wordSpacing', 'zIndex']; +var dashed_properties = properties.map(function (property) { + return camelToDashed(property); +}); + +module.exports = { + 'Verify Has Properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(properties.length * 2); + properties.forEach(function (property) { + test.ok(style.__lookupGetter__(property), 'missing ' + property + ' property'); + test.ok(style.__lookupSetter__(property), 'missing ' + property + ' property'); + }); + test.done(); + }, + 'Verify Has Dashed Properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(dashed_properties.length * 2); + dashed_properties.forEach(function (property) { + test.ok(style.__lookupGetter__(property), 'missing ' + property + ' property'); + test.ok(style.__lookupSetter__(property), 'missing ' + property + ' property'); + }); + test.done(); + }, + 'Verify Has Functions': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(6); + test.ok(typeof style.getPropertyValue === 'function', 'missing getPropertyValue()'); + test.ok(typeof style.getPropertyCSSValue === 'function', 'missing getPropertyCSSValue()'); + test.ok(typeof style.removeProperty === 'function', 'missing removeProperty()'); + test.ok(typeof style.getPropertyPriority === 'function', 'missing getPropertyPriority()'); + test.ok(typeof style.setProperty === 'function', 'missing setProperty()'); + test.ok(typeof style.item === 'function', 'missing item()'); + test.done(); + }, + 'Verify Has Special Properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(5); + test.ok(style.__lookupGetter__('cssText'), 'missing cssText getter'); + test.ok(style.__lookupSetter__('cssText'), 'missing cssText setter'); + test.ok(style.__lookupGetter__('length'), 'missing length getter'); + test.ok(style.__lookupSetter__('length'), 'missing length setter'); + test.ok(style.__lookupGetter__('parentRule'), 'missing parentRule getter'); + test.done(); + }, + 'Test From Style String': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(8); + style.cssText = 'color: blue; background-color: red; width: 78%'; + test.ok(3 === style.length, 'length is not 3'); + test.ok('color: blue; background-color: red; width: 78%;' === style.cssText, 'cssText is wrong'); + test.ok('blue' === style.getPropertyValue('color'), "getPropertyValue('color') failed"); + test.ok('color' === style.item(0), 'item(0) failed'); + test.ok('background-color' === style[1], 'style[1] failed'); + test.ok('red' === style.backgroundColor, 'style.backgroundColor failed with "' + style.backgroundColor + '"'); + style.cssText = ''; + test.ok('' === style.cssText, 'cssText is not empty'); + test.ok(0 === style.length, 'length is not 0'); + test.done(); + }, + 'Test From Properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(11); + style.color = 'blue'; + test.ok(1 === style.length, 'length is not 1'); + test.ok('color' === style[0], 'style[0] is not color'); + test.ok('color: blue;' === style.cssText, 'cssText is wrong'); + test.ok('color' === style.item(0), 'item(0) is not color'); + test.ok('blue' === style.color, 'color is not blue'); + style.backgroundColor = 'red'; + test.ok(2 === style.length, 'length is not 2'); + test.ok('color' === style[0], 'style[0] is not color'); + test.ok('background-color' === style[1], 'style[1] is not background-color'); + test.ok('color: blue; background-color: red;' === style.cssText, 'cssText is wrong'); + test.ok('red' === style.backgroundColor, 'backgroundColor is not red'); + style.removeProperty('color'); + test.ok('background-color' === style[0], 'style[0] is not background-color'); + test.done(); + }, + 'Test Shorthand Properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(11); + style.background = 'blue url(http://www.example.com/some_img.jpg)'; + test.ok('blue' === style.backgroundColor, 'backgroundColor is not blue'); + test.ok('url(http://www.example.com/some_img.jpg)' === style.backgroundImage, 'backgroundImage is wrong'); + test.ok('blue url(http://www.example.com/some_img.jpg)' === style.background, 'background is different'); + style.border = '0 solid black'; + test.ok('0px' === style.borderWidth, 'borderWidth is not 0px'); + test.ok('solid' === style.borderStyle, 'borderStyle is not solid'); + test.ok('black' === style.borderColor, 'borderColor is not black'); + test.ok('0px' === style.borderTopWidth, 'borderTopWidth is not 0px'); + test.ok('solid' === style.borderLeftStyle, 'borderLeftStyle is not solid'); + test.ok('black' === style.borderBottomColor, 'borderBottomColor is not black'); + style.font = '12em monospace'; + test.ok('12em' === style.fontSize, 'fontSize is not 12em'); + test.ok('monospace' === style.fontFamily, 'fontFamily is not monospace'); + test.done(); + }, + 'Test width and height Properties and null and empty strings': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(7); + style.height = 6; + test.ok('' === style.height, 'height does not remain unset'); + style.width = 0; + test.ok('0px' === style.width, 'width is not 0px'); + style.height = '34%'; + test.ok('34%' === style.height, 'height is not 34%'); + style.height = ''; + test.ok(style.length === 1, 'length is not 1'); + test.ok('width: 0px;' === style.cssText, 'cssText is not "width: 0px;"'); + style.width = null; + test.ok(style.length === 0, 'length is not 0'); + test.ok('' === style.cssText, 'cssText is not empty string'); + test.done(); + }, + 'Test Implicit Properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(7); + style.borderWidth = 0; + test.ok(1 === style.length, 'length is not 1'); + test.ok('0px' === style.borderWidth, 'borderWidth is not 0px'); + test.ok('0px' === style.borderTopWidth, 'borderTopWidth is not 0px'); + test.ok('0px' === style.borderBottomWidth, 'borderBottomWidth is not 0px'); + test.ok('0px' === style.borderLeftWidth, 'borderLeftWidth is not 0px'); + test.ok('0px' === style.borderRightWidth, 'borderRightWidth is not 0px'); + test.ok('border-width: 0px;' === style.cssText, 'cssText is not "border-width: 0px", "' + style.cssText + '"'); + test.done(); + }, + 'Test Top, Left, Right, Bottom Properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(6); + style.top = 0; + style.left = '0%'; + style.right = '5em'; + style.bottom = '12pt'; + test.ok('0px' === style.top, 'top is not 0px'); + test.ok('0%' === style.left, 'left is not 0%'); + test.ok('5em' === style.right, 'right is not 5em'); + test.ok('12pt' === style.bottom, 'bottom is not 12pt'); + test.ok(4 === style.length, 'length is not 4'); + test.ok('top: 0px; left: 0%; right: 5em; bottom: 12pt;' === style.cssText, 'text is not "top: 0px; left: 0%; right: 5em; bottom: 12pt;"'); + test.done(); + }, + 'Test Clear and Clip Properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(10); + style.clear = 'none'; + test.ok('none' === style.clear, 'clear is not none'); + style.clear = 'lfet'; // intentionally wrong + test.ok('none' === style.clear, 'clear is not still none'); + style.clear = 'left'; + test.ok('left' === style.clear, 'clear is not left'); + style.clear = 'right'; + test.ok('right' === style.clear, 'clear is not right'); + style.clear = 'both'; + test.ok('both' === style.clear, 'clear is not both'); + style.clip = 'elipse(5px, 10px)'; + test.ok('' === style.clip, 'clip should not be set'); + test.ok(1 === style.length, 'length is not 1'); + style.clip = 'rect(0, 3Em, 2pt, 50%)'; + test.ok('rect(0px, 3em, 2pt, 50%)' === style.clip, 'clip is not "rect(0px, 3em, 2pt, 50%)", "' + style.clip + '"'); + test.ok(2 === style.length, 'length is not 2'); + test.ok('clear: both; clip: rect(0px, 3em, 2pt, 50%);' === style.cssText, 'cssText is not "clear: both; clip: rect(0px, 3em, 2pt, 50%);"'); + test.done(); + }, + 'Test colors': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(4); + style.color = 'rgba(0,0,0,0)'; + test.ok('rgba(0, 0, 0, 0)' === style.color, 'color is not rgba(0, 0, 0, 0)'); + style.color = 'rgba(5%, 10%, 20%, 0.4)'; + test.ok('rgba(12, 25, 51, 0.4)' === style.color, 'color is not rgba(12, 25, 51, 0.4)'); + style.color = 'rgb(33%, 34%, 33%)'; + test.ok('rgb(84, 86, 84)' === style.color, 'color is not rgb(84, 86, 84)'); + style.color = 'rgba(300, 200, 100, 1.5)'; + test.ok('rgb(255, 200, 100)' === style.color, 'color is not rgb(255, 200, 100) ' + style.color); + test.done(); + }, + 'Test short hand properties with embedded spaces': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(4); + style.background = 'rgb(0, 0, 0) url(/something/somewhere.jpg)'; + test.ok('rgb(0, 0, 0)' === style.backgroundColor, 'backgroundColor is not rgb(0, 0, 0): ' + style.backgroundColor); + test.ok('url(/something/somewhere.jpg)' === style.backgroundImage, 'backgroundImage is not url(/something/somewhere.jpg): ' + style.backgroundImage); + test.ok('background: rgb(0, 0, 0) url(/something/somewhere.jpg);' === style.cssText, 'cssText is not correct: ' + style.cssText); + style = new cssstyle.CSSStyleDeclaration(); + style.border = ' 1px solid black '; + test.ok('1px solid black' === style.border, 'multiple spaces not properly parsed: ' + style.border); + test.done(); + }, + 'Setting shorthand properties to an empty string should clear all dependent properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(2); + style.borderWidth = '1px'; + test.ok('border-width: 1px;' === style.cssText, 'cssText is not "border-width: 1px;": ' + style.cssText); + style.border = ''; + test.ok('' === style.cssText, 'cssText is not "": ' + style.cssText); + test.done(); + }, + 'Setting implicit properties to an empty string should clear all dependent properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(2); + style.borderTopWidth = '1px'; + test.ok('border-top-width: 1px;' === style.cssText, 'cssText is not "border-top-width: 1px;": ' + style.cssText); + style.borderWidth = ''; + test.ok('' === style.cssText, 'cssText is not "": ' + style.cssText); + test.done(); + }, + 'Setting a shorthand property, whose shorthands are implicit properties, to an empty string should clear all dependent properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(4); + style.borderTopWidth = '1px'; + test.ok('border-top-width: 1px;' === style.cssText, 'cssText is not "border-top-width: 1px;": ' + style.cssText); + style.border = ''; + test.ok('' === style.cssText, 'cssText is not "": ' + style.cssText); + style.borderTop = '1px solid black'; + test.ok('border-top: 1px solid black;' === style.cssText, 'cssText is not "border-top: 1px solid black;": ' + style.cssText); + style.border = ''; + test.ok('' === style.cssText, 'cssText is not "": ' + style.cssText); + test.done(); + }, + 'Setting border values to "none" should clear dependent values': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(8); + style.borderTopWidth = '1px'; + test.ok('border-top-width: 1px;' === style.cssText, 'cssText is not "border-top-width: 1px;": ' + style.cssText); + style.border = 'none'; + test.ok('' === style.cssText, 'cssText is not "": ' + style.cssText); + style.borderTopWidth = '1px'; + test.ok('border-top-width: 1px;' === style.cssText, 'cssText is not "border-top-width: 1px;": ' + style.cssText); + style.borderTopStyle = 'none'; + test.ok('' === style.cssText, 'cssText is not "": ' + style.cssText); + style.borderTopWidth = '1px'; + test.ok('border-top-width: 1px;' === style.cssText, 'cssText is not "border-top-width: 1px;": ' + style.cssText); + style.borderTop = 'none'; + test.ok('' === style.cssText, 'cssText is not "": ' + style.cssText); + style.borderTopWidth = '1px'; + style.borderLeftWidth = '1px'; + test.ok('border-top-width: 1px; border-left-width: 1px;' === style.cssText, 'cssText is not "border-top-width: 1px; border-left-width: 1px;": ' + style.cssText); + style.borderTop = 'none'; + test.ok('border-left-width: 1px;' === style.cssText, 'cssText is not "border-left-width: 1px;": ' + style.cssText); + test.done(); + }, + 'Setting border to 0 should be okay': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(1); + style.border = 0; + test.ok('border: 0px;' === style.cssText, 'cssText is not "border: 0px;": ' + style.cssText); + test.done(); + }, + 'Setting values implicit and shorthand properties via cssText and setProperty should propagate to dependent properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(4); + style.cssText = 'border: 1px solid black;'; + test.ok('border: 1px solid black;' === style.cssText, 'cssText is not "border: 1px solid black;": ' + style.cssText); + test.ok('1px solid black' === style.borderTop, 'borderTop is not "1px solid black": ' + style.borderTop); + style.border = ''; + test.ok('' === style.cssText, 'cssText is not "": ' + style.cssText); + style.setProperty('border', '1px solid black'); + test.ok('border: 1px solid black;' === style.cssText, 'cssText is not "border: 1px solid black;": ' + style.cssText); + test.done(); + }, + 'Setting opacity should work': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(3); + style.setProperty('opacity', 0.75); + test.ok('opacity: 0.75;' === style.cssText, 'cssText is not "opacity: 0.75;": ' + style.cssText); + style.opacity = '0.50'; + test.ok('opacity: 0.5;' === style.cssText, 'cssText is not "opacity: 0.5;": ' + style.cssText); + style.opacity = 1.0; + test.ok('opacity: 1;' === style.cssText, 'cssText is not "opacity: 1;": ' + style.cssText); + test.done(); + }, + 'Width and height of auto should work': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(4); + style.width = "auto"; + test.equal(style.cssText,'width: auto;', 'cssText is not "width: auto;": ' + style.cssText); + test.equal(style.width,'auto', 'width is not "auto": ' + style.width); + style = new cssstyle.CSSStyleDeclaration(); + style.height = "auto"; + test.equal(style.cssText,'height: auto;', 'cssText is not "height: auto;": ' + style.cssText); + test.equal(style.height,'auto', 'height is not "auto": ' + style.height); + test.done(); + }, + 'Padding and margin should set/clear shorthand properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + var parts = ["Top","Right","Bottom","Left"]; + var testParts = function (name,v,V) { + style[name] = v; + for (var i = 0; i < 4; i++) { + var part = name + parts[i]; + test.equal(V[i],style[part], part + ' is not "' + V[i] + '": "' + style[part] + '"'); + } + test.equal(v,style[name], name + ' is not "' + v + '": "' + style[name] + '"'); + style[name] = ""; + }; + test.expect(50); + testParts("padding","1px",["1px","1px","1px","1px"]); + testParts("padding","1px 2%",["1px","2%","1px","2%"]); + testParts("padding","1px 2px 3px",["1px","2px","3px","2px"]); + testParts("padding","1px 2px 3px 4px",["1px","2px","3px","4px"]); + style.paddingTop = style.paddingRight = style.paddingBottom = style.paddingLeft = "1px"; + testParts("padding","",["","","",""]); + testParts("margin","1px",["1px","1px","1px","1px"]); + testParts("margin","1px auto",["1px","auto","1px","auto"]); + testParts("margin","1px 2% 3px",["1px","2%","3px","2%"]); + testParts("margin","1px 2px 3px 4px",["1px","2px","3px","4px"]); + style.marginTop = style.marginRight = style.marginBottom = style.marginLeft = "1px"; + testParts("margin","",["","","",""]); + test.done(); + }, + 'Padding and margin shorthands should set main properties': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + var parts = ["Top","Right","Bottom","Left"]; + var testParts = function (name,v,V) { + var expect; + for (var i = 0; i < 4; i++) { + style[name] = v; + style[name+parts[i]] = V; + expect = v.split(/ /); + expect[i] = V; + expect = expect.join(" "); + test.equal(expect,style[name], name + ' is not "' + expect + '": "' + style[name] + '"'); + } + }; + test.expect(12); + testParts("padding","1px 2px 3px 4px","10px"); + testParts("margin","1px 2px 3px 4px","10px"); + testParts("margin","1px 2px 3px 4px","auto"); + test.done(); + }, + 'Setting a value to 0 should return the string value': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(1); + style.setProperty('fill-opacity', 0); + test.ok('0' === style.fillOpacity, 'fillOpacity is not "0": ' + style.fillOpacity); + test.done(); + }, + 'onChange callback should be called when the cssText changes': function (test) { + var style = new cssstyle.CSSStyleDeclaration(function (cssText) { + test.ok('opacity: 0;' === cssText, 'cssText is not "opacity: 0;": ' + cssText); + test.done(); + }); + test.expect(1); + style.setProperty('opacity', 0); + }, + 'Setting float should work the same as cssFloat': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(1); + style.float = 'left'; + test.ok('left' === style.cssFloat, 'cssFloat is not "left": ' + style.cssFloat); + test.done(); + }, + 'Setting improper css to cssText should not throw': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(2); + style.cssText = 'color: '; + test.ok('' === style.cssText, 'cssText wasn\'t cleared: ' + style.cssText); + style.color = 'black'; + style.cssText = 'float: '; + test.ok('' === style.cssText, 'cssText wasn\'t cleared: ' + style.cssText); + test.done(); + }, + 'Make sure url parsing works with quotes': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(3); + style.backgroundImage = 'url(http://some/url/here1.png)'; + test.ok('url(http://some/url/here1.png)' === style.backgroundImage, 'background-image wasn\'t url(http://some/url/here1.png): ' + style.backgroundImage); + style.backgroundImage = 'url(\'http://some/url/here2.png\')'; + test.ok('url(http://some/url/here2.png)' === style.backgroundImage, 'background-image wasn\'t url(http://some/url/here2.png): ' + style.backgroundImage); + style.backgroundImage = 'url("http://some/url/here3.png")'; + test.ok('url(http://some/url/here3.png)' === style.backgroundImage, 'background-image wasn\'t url(http://some/url/here3.png): ' + style.backgroundImage); + test.done(); + }, + 'Make sure setting 0 to a padding or margin works': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(2); + style.padding = 0; + test.equal(style.cssText, 'padding: 0px;', 'padding is not 0px'); + style.margin = '1em'; + style.marginTop = '0' + test.equal(style.marginTop, '0px', 'margin-top is not 0px'); + test.done(); + }, + 'Make sure setting null to background works': function (test) { + var style = new cssstyle.CSSStyleDeclaration(); + test.expect(2); + style.background = 'red'; + test.equal(style.cssText, 'background: red;', 'background is not red'); + style.background = null; + test.equal(style.cssText, '', 'cssText is not empty'); + test.done(); + } +}; diff --git a/node_modules/dashdash/CHANGES.md b/node_modules/dashdash/CHANGES.md new file mode 100644 index 0000000..d7c8f4e --- /dev/null +++ b/node_modules/dashdash/CHANGES.md @@ -0,0 +1,364 @@ +# node-dashdash changelog + +## not yet released + +(nothing yet) + +## 1.14.1 + +- [issue #30] Change the output used by dashdash's Bash completion support to + indicate "there are no completions for this argument" to cope with different + sorting rules on different Bash/platforms. For example: + + $ triton -v -p test2 package get # before + ##-no -tritonpackage- completions-## + + $ triton -v -p test2 package get # after + ##-no-completion- -results-## + +## 1.14.0 + +- New `synopsisFromOpt(